I have a simple application that loads two assemblies at runtime from 2 subfolders through this piece of code:
Assembly.Load("A, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"); Assembly.Load("B, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
Directory structure:

Thus, the expected download is as follows:
TheApp.exe -> A.dll -> C.dll (version 2.0.0.0) -> B.dll -> C.dll (version 1.0.0.0)
Please note that C.dll signed, so both versions must be downloaded side by side.
To make the application load assemblies from the right places, I added the following to the application configuration file:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="B;A" /> </assemblyBinding> </runtime> </configuration>
The problem is the application crashes when a message appears every time it starts:
=== Pre-bind state information === LOG: User = ... LOG: DisplayName = C, Version=2.0.0.0, Culture=neutral, PublicKeyToken=93a02044a09d059a (Fully-specified) LOG: Appbase = file:///D:/Temp/TheApp/bin/Debug/Test/ LOG: Initial PrivatePath = NULL Calling assembly : A, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in default load context. LOG: Using application configuration file: D:\Temp\TheApp\bin\Debug\Test\TheApp.exe.Config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Post-policy reference: C, Version=2.0.0.0, Culture=neutral, PublicKeyToken=93a02044a09d059a LOG: Attempting download of new URL file:///D:/Temp/TheApp/bin/Debug/Test/C.DLL. LOG: Attempting download of new URL file:///D:/Temp/TheApp/bin/Debug/Test/C/C.DLL. LOG: Attempting download of new URL file:///D:/Temp/TheApp/bin/Debug/Test/B/C.DLL. WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
QUESTION : Why does the runtime look only at folder “B”? Why doesn't he continue to search for the correct version of the general assembly in folder A?
EDIT1 . I added the <codeBase> tag as follows, I know that there is the following in my configuration file:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="B;A" /> </assemblyBinding> <dependentAssembly> <assemblyIdentity name="C" publicKeyToken="93a02044a09d059a" /> <codeBase version="1.0.0.0" href="B/C.dll"/> <codeBase version="2.0.0.0" href="A/C.dll"/> </dependentAssembly> </runtime> </configuration>
Nevertheless, the problem remains!