ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated

4

I am seeing this strange issue. I would like to inform that there are many posts on this error but none of them solved the issue that I am facing. Below is my setup.

  1. I have an exe file and in csproj of this file, target framework version is set to v3.5
  2. This exe file loads many of my custom dlls.
  3. Out of all these custom dlls, only 1 dll has target framework version as v4.5, rest all are v3.5
  4. Also, in my exe's config file, I have supported runtime entry for all 3 versions (see code section below for entries)

This means that the exe even though built using v3.5, it should support loading dlls with v4.5 right ? However as soon as I try to load the dll (with v4.5), I get above error. I tried enabling assembly logging - but all I see is

//Config file entry start
<startup> 
<supportedRuntime version="v2.0.50727"/> 
<supportedRuntime version="v4.0"/>     
<supportedRuntime version="v4.5"/> 
</startup>
//Config file entry end

//Error start
Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable  d:\My.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = 
LOG: Where-ref bind. Location = d:\MyCustom.dll
LOG: Appbase = file:///D:/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: d:\My.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Attempting download of new URL file:///D:/MyCustom.dll.
ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated.

My control panel says, I have .NET framework 4.5 but I do not see 'Full' entry, I see only 'client' How to: Determine Which .NET Framework Versions Are Installed

I also tried installing .NET 4.5, but all it does is - it tries to repair. My OS version is Windows 7 professional SP1.

Any clues. Please help. Thanks.

c#
.net
dll
asked on Stack Overflow Nov 27, 2013 by user1576882 • edited Nov 27, 2013 by user1576882

1 Answer

3

Check out the documentation of the supportedRuntime element, the order matters.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll

This tells you that you're running on the .NET 2.0 runtime. You're never going to be able to load a 4.5 dll while running on the 2.0 runtime.

answered on Stack Overflow Jan 24, 2014 by Sean Hall

User contributions licensed under CC BY-SA 3.0