简体   繁体   中英

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. Now .NET 4.0 is out. My understanding is that if a user installs 4.0, they do not necessarily also install 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. So, when a user installs our software, they are instructed to get 3.5, they accidentally download 4.0, and the app complains.

The simple solution would be to have the installer require 4.0 since it is backwards compatible, however, we're still using VS 2008; when I edit requirements, the list of .NET version only goes up to 3.5.

Is there a way to have the installer require 4.0?

It seems a shame to upgrade to VS 2010 solely to change two characters of text in a config file.

NOTE: I am not trying to target .NET 4.0 in my code, just ensure that it is the installed version.

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.

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

您可以添加引导程序

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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