我看到这个奇怪的问题。我想告知这个错误有很多帖子,但没有一个解决了我所面临的问题。以下是我的设置。
这意味着即使使用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 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.
我的控制面板说,我有.NET framework 4.5,但我看不到'完整'条目,我只看到'客户'How to: Determine Which .NET Framework Versions Are Installed
我也尝试过安装.NET 4.5,但它只是 - 它试图修复。 我的操作系统版本是Windows 7专业版SP1。
任何线索。请帮忙。感谢。
答案 0 :(得分:1)
查看supportedRuntime元素的documentation,订单很重要。
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
这告诉您正在运行.NET 2.0运行时。在2.0运行时运行时,您永远无法加载4.5 dll。