gpt4 book ai didi

c# - 在 .Net 4.0 程序中运行 .Net 2.0 可执行文件

转载 作者:行者123 更新时间:2023-11-30 12:30:12 34 4
gpt4 key购买 nike

我正在尝试从我的程序运行外部可执行文件。我的程序是在.Net 4.0框架上编译的,以使其能够在Windows XP上运行。外部应用程序是在.Net 2.0 框架上编译的。当我在我的机器(安装了 Windows 7,.Net 4.5)上运行这个程序时,它工作正常,但是当我在安装了 .Net 4.0 的 XP 中运行它时,我收到以下错误:无法找到运行时的版本运行此应用程序。 我尝试按如下方式修改 app.config 文件,但没有成功:

<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v2.0" sku=".NETFramework,Version=v2.0"/>
</startup>
</configuration>

还有其他方法可以解决这个问题吗?

最佳答案

In general, you should not uninstall any versions of the .NET Framework that are installed on your computer, because an application you use may depend on a specific version and may break if that version is removed. You can load multiple versions of the .NET Framework on a single computer at the same time. This means that you can install the .NET Framework without having uninstall previous versions. For more information, see Getting Started with the .NET Framework. http://msdn.microsoft.com/en-us/library/bb822049.aspx

关于c# - 在 .Net 4.0 程序中运行 .Net 2.0 可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16859200/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com