在.NET 4中,仅系统上运行.NET 3.5的应用程序 [英] Running .NET 3.5 apps on .NET 4 only systems

查看:135
本文介绍了在.NET 4中,仅系统上运行.NET 3.5的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题已经被问之前可能多次,但我不能让典型的解决方案,为我工作。该提出的解决方案是把它放到了的app.config文件:

This question has been asked before perhaps multiple times, but I can't get the typical solution to work for me. The proposed solution is to put this in the "app.config" file:

<configuration>
   <startup>
      <supportedRuntime version="v4.0"/>
   </startup>
</configuration>

但是,一个简单的Hello World程序,我仍然得到错误:无法找到一个版本的运行时运行此程序。

But with a simple "Hello World" program, I still get the error: "Unable to find a version of the runtime to run this application.".

有关的一些背景,我(在Windows 7上通过Windows虚拟PC)使用的是Windows XP,并且只能安装在XP上的.NET 4.0运行时。

For some background, I'm using Windows XP (through Windows Virtual PC on Windows 7), and only installed the .NET 4.0 runtime on XP.

经过一番研究,我发现这个页面: <一href="http://msdn.microsoft.com/en-us/library/ee941656.aspx#core">http://msdn.microsoft.com/en-us/library/ee941656.aspx#core

After some research, I found this page: http://msdn.microsoft.com/en-us/library/ee941656.aspx#core

它提到如果你的应用程序配置文件被命名为应用程序名称.config,其重命名为应用程序name.exe.config。例如,重命名MyApp.config到MyApp.exe.config。

It mentioned "If your application configuration file is named application-name.config, rename it to application-name.exe.config. For example, rename MyApp.config to MyApp.exe.config.".

我试过了,认为它可以解决这个问题,但我仍然得到无法找到一个版本的运行时运行该应用程序。当我尝试使用.NET 4.0运行在WinXP的.NET 3.5(客户端配置文件或已满)的应用程序。

I tried that, thinking it could solve the issue, but I still get "Unable to find a version of the runtime to run this application." when I try to run the .NET 3.5 (client profile or full) application on WinXP with .NET 4.0.

推荐答案

我破解它。这听起来愚蠢的,但事实证明,该配置文件需要与用户的文件夹中的最后一个可执行文件。毕竟我的研究,这并没有出现在任何地方进行澄清。我想它只是用于编译目的是在开发者的文件夹中。

I cracked it. This might sound daft, but it turns out that the config file needed to be with the final executable in the user's folder. After all my researching, this didn't appear to be clarified anywhere. I was thinking it was only used for compiling purposes to be in the developer's folder.

在VS编辑文件列表,它可以保持为的app.config。但是,在编译时,VS会自动创建{} ProgramName中.exe.config,而不是(并把它的bin / release文件夹)。这是一个需要走在最终用户的文件夹沿着与可执行文件。

In the VS editor file list, it can remain as "app.config". However, when compiled, VS automatically creates "{ProgramName}.exe.config" instead (and puts it in the bin/release folder). This is the file that needs to go in the end user's folder along with the executable.

要总结,是的,它可以运行在.NET 3.5的系统中只有.NET 4.0的应用程序安装。

To summarize, yes, it is possible to run a .NET 3.5 app on a system which only has .NET 4.0 installed.

这篇关于在.NET 4中,仅系统上运行.NET 3.5的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆