Also note:
LoadFrom: .NET caches the assembly, so if the assembly was already loaded
earlier (assembly with no strong name) it returns the first assembly loaded
(hashed by name?), regardless of version number. The path is basically
ignored.
This method also looks for and loads all dependant assembly items.
http://msdn2.microsoft.com/en-us/library/1009fa28.aspx
Also Load and/or LoadFile only loads the specified assembly, and not the
related/dependant items, which can cause problems.
Eric Schneider
> Hi Luis,
>
[quoted text clipped - 39 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Luis F. Rodas - 24 Jan 2008 12:13 GMT
Hi Linda and Eric,
Thanks for your replies!
I would like to know how Visual Studio 2005 gets the original directories
from some assemblies, such as: System.Design.dll, System.Windows.Forms.dll.
I saw this in the 'References/Properties/Path'. Also probably Visual Studio
loads these asssemblies from the original directories.
Again thanks and best regards!
Luis F.
(Indusoft Team)
> Also note:
>
[quoted text clipped - 57 lines]
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
Linda Liu[MSFT] - 28 Jan 2008 08:12 GMT
Hi Luis,
Thank you for your reply!
Open a WinForm application project in VS and right click on the project
item in the Solution Explorer and choose Add Reference command, which will
open the Add Reference dialog.
In the Add Reference dialog, the assemblies shown in the .NET tab are all
retrieved from the original directories by VS, not from GAC.
However, when the WinForm application is run, all the referenced assemblies
that have been cached in the GAC are loaded from the GAC, instead of from
the original directories.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Luis F. Rodas - 29 Jan 2008 10:47 GMT
Hi Linda,
Do you have any idea how VS gets the original directories in the Add
Reference dialog ? In my program I would like to display the path of the
controls from the original directories too.
Best Regards,
Luis F.
(Indusoft Team)
> Hi Luis,
>
[quoted text clipped - 17 lines]
> Linda Liu
> Microsoft Online Community Support
Linda Liu[MSFT] - 31 Jan 2008 10:29 GMT
Hi Luis,
Thank you for your reply!
> Do you have any idea how VS gets the original directories in the Add
Reference dialog ?
IMO, VS searches the assemblies file in some specific directories. So the
original directories are shown in the Add Reference dialog. Note that the
assemblies are not loaded when they are referenced by VS.
> In my program I would like to display the path of the controls from the
original directories too.
The only suggestion I can make is to remove your assembly from GAC. Then
you load the assembly from the original directory.
Sincerely,
Linda Liu
Microsoft Online Community Support