PC Review


Reply
Thread Tools Rate Thread

Assembly dinamic load

 
 
Juan
Guest
Posts: n/a
 
      31st Jan 2005
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


 
Reply With Quote
 
 
 
 
Dmitriy Lapshin [C# / .NET MVP]
Guest
Posts: n/a
 
      31st Jan 2005
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.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Juan" <(E-Mail Removed)> wrote in message
news:O$(E-Mail Removed)...
> 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
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Assembly.Load get returns wrong assembly. =?Utf-8?B?VmxhZCBIcnlib2s=?= Microsoft Dot NET Framework 13 1st Feb 2007 12:40 PM
Using Assembly.Load(byte[]) to load multiple versions of dll, and AppDomain.AssemblyResolve Stephen Ahn Microsoft Dot NET Framework 1 8th May 2006 10:35 AM
Diif Assembly.Load and Assembly.LoadFrom =?Utf-8?B?R3VqanU=?= Microsoft VB .NET 1 22nd Jul 2005 09:54 AM
How to use Assembly.LoadFile to load assembly in different path? =?Utf-8?B?bGVlenE=?= Microsoft Dot NET Framework 0 19th Jun 2004 07:23 AM
Cannot CreateInstance of Assembly after loading it with Assembly.Load(byte[]) Dmitriy Krasnikov Microsoft Dot NET Framework 3 11th May 2004 07:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:12 PM.