Dinamically loaded assembly

J

Juan

Hello:

I have a strange behaviour loading dinamically an assembly in PDA 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

Daniel Moth

"Yesterday" vs "today" has more likely to do with versions.

When you reference an assembly, it will first look for an .exe and then for
a .dll extension - this is by design (an exe referencing another exe is
legal). Any particular reason you are naming them the same?

Cheers
Daniel
 
J

Juan

There weren't any particular reasons when I created it, but now I can't
change it because of other reasons.

Still i don't understand why of the different dates can cause it to work. I
make some probes and I think it's a preferences trouble (as you said), if
they are called with the same name, the exe has priority over the dll, and
if they have not the same date, takes the dll correctly (with the same name)

The solution is to change the DLL name, but I can't do that :)

Thanks for your help Daniel.

Juan
 
D

Daniel Moth

A slight correction...
"Yesterday" vs "today" has more likely to do with versions.
This should be: *definitely* has to do with versions. CF 1.0 versioning
rules dictate that major.minor.build should match. Look in your AssemblyInfo
file for changing those.
When you reference an assembly, it will first look for an .exe and then
for a .dll extension - this is by design (an exe referencing another exe
is
Got this the wrong way round. First it looks for a dll extension and then
for an exe. So in your case it cannot find the dll and then loads the exe.

Cheers
Daniel
 

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