Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Order of Assemblies Being Loaded

I have a few .Net assemblies, same version, same file name, but located at different location:

  1. Program folder
  2. C:\Windows
  3. C:\Windows\system32
  4. GAC

Now, which location's assembly will be loaded first?

like image 310
Graviton Avatar asked Jun 05 '09 04:06

Graviton


1 Answers

.Net assemblies has different search order than regular windows .dll. GAC will be checked the first thing ONLY if the assembly is strongly named signed. If the assembly is not in the gac / not strong name signed , the local folder is checked after that. That is the end of the .net assembly search order, 1,2 and 3 above are not checked.

you can change where the .net looks for assembly by having a local configuration file for you app.

Also, this post in the microsoft.public.dotnet.framework.aspnet group contain very useful information.

like image 68
mfawzymkh Avatar answered Sep 28 '22 00:09

mfawzymkh