简体   繁体   English

升级到Windows 10后,将构建混合模式程序集

[英]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.

相关问题 混合模式程序集针对版本xxxx构建 - Mixed mode assembly is built against version xxxx 混合模式程序集是根据运行时的版本“v2.0.50727”构建的 - Mixed mode assembly is built against version ‘v2.0.50727′ of the runtime 混合模式组件是针对“v2.0.50727”错误构建的 - Mixed mode assembly is built against 'v2.0.50727' error .NET 4中的混合模式汇编 - Mixed mode assembly in .NET 4 Windows服务无法启动,混合模式组装问题 - Windows service fails start , Mixed Mode Assembly issue 如何处理jni4net中针对版本v2.0.50727错误的混合模式程序集 - how to handle Mixed mode assembly is built against version v2.0.50727 error in jni4net 如何查找导致哪个dll的文件:“针对版本…构建的混合模式程序集……无法在4.0运行时中加载”? - How find which dll is causing: “Mixed mode assembly built against version … cannot be loaded in 4.0 runtime”? 混合模式程序集是针对运行时的版本“2.0.50727”构建的,无法在4.0运行时中加载 - Mixed mode assembly is built against version '2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime 混合模式程序集是针对旧版本的运行时构建的,如果没有其他配置,则无法加载 - Mixed mode assembly is built against old version of the runtime and cannot be loaded without additional configuration 针对版本&#39;v2.0.50727&#39;构建了混合模式程序集…在本机C ++ / Visual C ++ / C#项目上出错 - Mixed mode assembly is built against version 'v2.0.50727' … error on native C++ / Visual C++ / C# projects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM