简体   繁体   English

强制安装程序在VS 2008中要求.NET 4.0

[英]Force installer to require .NET 4.0 in VS 2008

Last spring we forced our installer to require .NET 3.5 to resolve some compatibility issues. 去年春天,我们强制安装程序要求.NET 3.5解决一些兼容性问题。 Now .NET 4.0 is out. 现在.NET 4.0已经推出。 My understanding is that if a user installs 4.0, they do not necessarily also install 3.5. 我的理解是,如果用户安装4.0,他们不一定也安装3.5。

Although we instruct the users to install 3.5 in our warning message, the default selection on the .NET download page is 4.0. 虽然我们指示用户在我们的警告消息中安装3.5,但.NET下载页面上的默认选择是4.0。 So, when a user installs our software, they are instructed to get 3.5, they accidentally download 4.0, and the app complains. 因此,当用户安装我们的软件时,他们被指示获得3.5,他们不小心下载4.0,并且应用程序抱怨。

The simple solution would be to have the installer require 4.0 since it is backwards compatible, however, we're still using VS 2008; 简单的解决方案是让安装程序需要4.0,因为它是向后兼容的,但是,我们仍在使用VS 2008; when I edit requirements, the list of .NET version only goes up to 3.5. 当我编辑需求时,.NET版本列表最多只能达到3.5。

Is there a way to have the installer require 4.0? 有没有办法让安装程序需要4.0?

It seems a shame to upgrade to VS 2010 solely to change two characters of text in a config file. 升级到VS 2010仅仅是为了更改配置文件中的两个文本字符似乎是一种耻辱。

NOTE: I am not trying to target .NET 4.0 in my code, just ensure that it is the installed version. 注意:我不是试图在我的代码中使用.NET 4.0,只是确保它是已安装的版本。

I think it would be easier to add the following in your app.config instead, which should ensure that your app runs whether the user installs 3.5 or 4 and stop your app complaining. 我认为在app.config中添加以下内容会更容易,这应该确保您的应用运行是否用户安装3.5或4并停止您的应用抱怨。

<startup>
  <supportedRuntime version="v4.0" sku="Client" />
  <supportedRuntime version="v2.0.50727" sku="Client"/>
</startup>

您可以添加引导程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM