我使用小应用程序,它在windows 8.1上运行良好,在运行应用程序后升级到windows 10之后,我得到了未处理的异常
System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.不用重新编译,我能用它做点什么吗?我已经没有源代码了。也许编辑MSIL,SetUp旧运行时.??
谢谢你的帮助
发布于 2015-09-07 21:52:53
您不需要重新编译应用程序。应该足够将yourapp.exe.config添加到同一个文件夹中:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>或添加到现有配置中。
如果这不起作用,而且您没有源代码,则可以通过以下方式将应用程序解压缩为IL代码:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools>ildasm.exe D:\Temp\yourapp.exe /output:D:\Temp\yourapp\yourapp.il修复IL中的运行时版本,然后编译它
C:\Windows\Microsoft.NET\Framework\v4.0.30319>ilasm.exe D:\Temp\yourapp\yourapp.il /output:D:\Temp\yourappPatch.exe发布于 2015-09-07 02:00:05
主要的问题是Windows8.x仍然接受.Net Framework2.0的兼容性(我想是出于ASP的目的),但是Windows 10拒绝了它。
我想你不会有任何解决方案,除非你必须重新编译你的应用程序,添加参考库,并设置要放在你的应用程序文件夹。
https://stackoverflow.com/questions/32429536
复制相似问题