Assembly dinamic load

J

Juan

Hello:

I have a strange behaviour loading dinamically an assembly with
Assembly.LoadFrom. The DLL is in the same directory as the main EXE, and has
the same name :

AICA.exe
AICA.dll

When I implement( or copy manually) yesterday builded AICA.dll main
application takes it without troubles, but if I build now (today) a new
AICA.dll, the Assembly.LoadFrom static method returns the AICA.exe assembly,
instead of AICA.dll.

Anybody nows why occurs this?

Thanks

Juan
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hello Juan,

The Framework considers the name of the file WITHOUT the extension to be the
assembly name (not sure if this can be overridden in the manifest).
Therefore, having two assemblies which differ only in extension is generally
not a good idea. You can however overcome this by having different version
numbers in the DLL and the EXE and by loading the assembly with the Load
method, specifying the desired version number.

But, if possible, I'd recommend that you renamed one of the files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top