简体   繁体   中英

How to tell an application to run on a specific .net runtime

In my development computer I have .net 3.0 and 3.5 installed. I'm developing with vs2005 on .net FW3.0

How can I tell the application to use the 3.0 assembleis insted of the 3.5?

Another approach is to use the config file:

 <startup>
  <supportedRuntime version="v3.0.3061"/>
 </startup>

something like that - check the actual version numbers.

hope this helps

Toby

Make sure you remove all referenced assemblies that are part of .NET 3.5 (such as System.Core , System.Data.DataSetExtensions , System.Xml.Linq ). Look at the version of each referenced assembly in the Properties Window - if it is 3.5.0.0 remove it. As .NET 3.0 and .NET 3.5 use the same CLR (v2.0.50727) there's nothing else you need to do.

The easiest way that I have done this is to use Project properties to target a specific .NET framework version.

In visual studio, go to the "Project" menu, then select Project Properties (usually at the bottom of the list).

There is then a drop down box called "Target Framework", which lets you choose from any of the frameworks compatible with your version of Visual Studio - eg 1, 1.1, 2.0, 3.0, 3.5, 4.0. Select this, make sure that you remove references to libraries from newer frameworks as Darin says, and then build away.

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