Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
953 views
in Technique[技术] by (71.8m points)

.net - 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:Windowssystem32
  4. GAC

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

.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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...