To make sure I understand: You'll have 2 .NET assemblies
and two legacy Dlls. You want each .NET assembly to
reference a specific version of the legacy Dll.
If this is the case then the trouble is with the way
Windows loads Dlls - there are no provisions for choosing
which version you want your .NET assemblies to load. My
*guess* is that you may have to avoid using the DllImport
attribute and load them manually. The Win32 API *might*
give you the flexibility to do this, but this is way out
of my league.
[quoted text, click to view] >-----Original Message-----
>James, thanks for your answer. What if the assembly is
on the GAC? I'm
>dealing with versioning issues, that's why I need to know
where to locate the
>..DLL. I need to be able to run two versions side by
side, that means 2
>assemblies on the GAC, and 2 .DLL, each set with
different version levels.
>
>Thanks
>
>
>
>"James" wrote:
>
>> You can always put the dll in the same folder as your
>> executable or referencing assembly. I have seen
articles
>> on this around the net but can't find one right now.
>>
>> >-----Original Message-----
>> >I don't want to put the .DLL in a known OS path
folder,
>> I'll like to define
>> >or load the .DLL from an specific location at
runtime.
>> How should I do it?
>> >
>> >
>> >Thanks in advance
>> >.
>> >
>>
>.
[quoted text, click to view] "Luis Fajardo" <LuisFajardo@discussions.microsoft.com> wrote in message
news:699E8DF8-96C0-47E9-BD0B-15B3FBD96F16@microsoft.com...
>I don't want to put the .DLL in a known OS path folder, I'll like to define
> or load the .DLL from an specific location at runtime. How should I do
> it?
This is just thinking out loud, though, as I have never tried it but ...
On very recent platforms (2K+3, XP/SP1) SetDllDirectory() might come in
handy. I'm not sure if it has a .Net equivalent or if you'd need to use
P/Invoke.
Regards,
Will