Difference between AppDomain.GetAssemblies and BuildManager.GetReferencedAssemblies

The .NET Framework defers loading assemblies into the current AppDomain until they’re needed. For example, if you call into a third-party library only from SomeMethod(), the third-party DLL normally won’t be loaded until the first time SomeMethod() runs. AppDomain.GetAssemblies() gives you all assemblies which have already been loaded into the current AppDomain. BuildManager.GetReferencedAssemblies() (This method … Read more

Using different versions of the same assembly in the same folder

I used the following configuration to resolve the issue. <configuration> <runtime> <assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″> <dependentAssembly> <assemblyIdentity name=”Castle.DynamicProxy2″ publicKeyToken=”407dd0808d44fbdc” /> <codeBase version=”2.1.0.0″ href=”https://stackoverflow.com/questions/2460542/v2.1\Castle.DynamicProxy2.dll” /> <codeBase version=”2.2.0.0″ href=”v2.2\Castle.DynamicProxy2.dll” /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name=”Castle.Core” publicKeyToken=”407dd0808d44fbdc” /> <codeBase version=”1.1.0.0″ href=”v2.1\Castle.Core.dll” /> <codeBase version=”1.2.0.0″ href=”v2.2\Castle.Core.dll” /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>