Where assemblies are loaded from?

89 views Asked by At

We have an azure service. The solution for it includes several projects. Some of projects references azure.storage ver. 4.2.1. Based on nugget.org the dependencies for azure.storage are odata, edm etc >= 5.6.0. We want to use the latest one 5.6.3. So we added to the projects references references to all dependent assemblies from version 5.6.3 (despite that ILSPY shows that the dependencies are for ver 5.6.0). But unfortunately the loaded dlls are from gac with version 5.6.0. (not from the path we referenced with the latest version) How the dlls are loaded ?:

  1. Based on Force load an assembly from the /bin and not the GAC? and http://msdn.microsoft.com/en-us/library/yx7xezcf.aspx - it loads assemblies from GAC firstable
  2. Based on http://blogs.msdn.com/b/manishagarwal/archive/2005/09/28/474769.aspx and Microsoft.Common.CurrentVersion.targets it should look first in bin directory - not gac.

What is correct? And how (it at all) can I achieve what I try to do?

1

There are 1 answers

9
Patrick Hofman On BEST ANSWER

You are comparing the resolving of an assembly for compilation to the resolving of assemblies on execution.

Both your points and their references are true, but only for their specific situation. Your #2 references explains the compilation process assembly resolving, your #1 references talk about the execution process.