微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c# – 错误:无法完成程序集的设置(hr = 0x8013101b).探测终止

我看到这个奇怪的问题.我想告知这个错误有很多帖子,但没有一个解决了我所面临的问题.以下是我的设置.

>我有一个exe文件,在这文件的csproj中,目标框架版本设置为v3.5
>这个exe文件加载了我的许多自定义dll.
>在所有这些自定义dll中,只有1个dll的目标框架版本为v4.5,其余都是v3.5
>另外,在我的exe配置文件中,我支持所有3个版本的运行时条目(请参阅下面的代码部分以获取条目)

这意味着即使使用v3.5构建的exe,它应该支持加载带有v4.5的dll吗?
但是,一旦我尝试加载dll(使用v4.5),我就会出现上述错误.我尝试启用程序集日志记录 – 但我所看到的只是

//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 @R_931_4045@ion ===
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.

我的控制面板说,我有.NET framework 4.5,但我看不到’Full’条目,我只看到’client’How to: Determine Which .NET Framework Versions Are Installed

我也尝试过安装.NET 4.5,但它只是 – 它试图修复.
我的操作系统版本是Windows 7专业版SP1.

任何线索.请帮忙.谢谢.

解决方法

查看supportedRuntime元素的 documentation,订单很重要.

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

这告诉您正在运行.NET 2.0运行时.在2.0运行时运行时,您永远无法加载4.5 dll.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐