NGen 错误无法加载运行时错误
在使用 .NET Framework 4 中的 NGen 编译一堆 DLL 程序集时,我遇到了一个奇怪的错误。安装对于某些 DLL 有效,但对于其他一些 DLL,它会产生以下错误消息:
无法加载运行时。 (HRESULT 异常:0x80131700)。程序集 AseeemblyFileLocation 需要运行时版本 v4.0.30319 才能运行。 安装正确的运行时后将编译程序集。
我确信我有正确的运行时版本。当我尝试在网络上搜索答案时,我发现没有人遇到过这个问题,这更奇怪。
有这方面的线索吗?谢谢。
I came across a strange error when using NGen from .NET Framework 4 to compile a bunch of DLL assemblies. The install worked for some of the DLLs, but for some others it produced the following error message:
Failed to load the runtime. (Exception from HRESULT: 0x80131700). Assembly AseemblyFileLocation requires version v4.0.30319 of the runtime to run.
Assembly will be compiled once the correct runtime is installed.
I am certain that I have the correct runtime version. I found that no one had come across this when I tried a search on web for answers, which is even stranger.
Any leads on this? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了这个问题,结果发现罪魁祸首是程序集 .config 文件中的以下条目:
删除它后,Ngen 运行良好。
I ran into this issue as well and it turned out the culprit was the following entry in the assembly .config file:
Once I removed it, Ngen ran fine.