[英]Mixed mode assembly is built, after upgrade to windows 10
I use small aplication, it works fine on windows 8.1, after I upgrade to windows 10 after run application I get Unhandled exception 我使用小应用程序,在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.
Can I do something with it, without re-compile? 我可以使用它做一些事情,而无需重新编译吗? I no longer have the source code.
我不再有源代码。 Maybe edit MSIL, SetUp old runtime...??
也许编辑MSIL,设置旧的运行时...?
Thanks for help 感谢帮助
You should not need recompile app. 您不需要重新编译应用程序。 Should suffice add yourapp.exe.config to same folder with:
应该使用以下命令将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>
or add to existing config. 或添加到现有配置。
if that does not work and you do not have source code, you can decompile app to IL code by 如果这不起作用并且您没有源代码,则可以通过以下方式将应用反编译为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
repair runtime version in IL and then compile it 在IL中修复运行时版本,然后对其进行编译
C:\Windows\Microsoft.NET\Framework\v4.0.30319>ilasm.exe D:\Temp\yourapp\yourapp.il /output:D:\Temp\yourappPatch.exe
The main problem is about Windows 8.x still accepts .Net Framework 2.0 compatibility (for ASP purposes, I guess) but Windows 10 refuses it. 主要问题是有关Windows 8.x仍然接受.Net Framework 2.0兼容性(我想是出于ASP的目的),但Windows 10拒绝了它。
I guess you won´t have any solution unless you MUST recompile your app adding the Reference Library and setting up to be put in your application folder. 我猜您将没有任何解决方案,除非您必须重新编译您的应用程序,添加参考库并将其设置为放置在应用程序文件夹中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.