I would li开发者_JAVA技巧ke to know how can i transform a .NET 4.0 VS 2010 C# project intro a 3.x .NET version? I just made an app for someone and i don't think he has the .NET 4.0 platform installed . Any ideas?
Change project target framework to 3.5 might work unless your using some 4.0 specific things.
Or make sure that the user has 4.0 installed if possible.
No, you cannot do it directly. You have three options:
- create a new project file that targets the 3.x framework and add the files to it (make sure they are not using v4.0 features)
- get your friend to install the v4.0 framework - it is roughly 50MB, not really that big
- as Jon pointed out, just retarget your project to v3.x in your VS2010 IDE (in the solution explorer, right click on your project, select Properties, go to the Application tab, use the Target framework dropdown)
if you have completed a reasonable amount of code it may be simpler to just install the new version of the framework.
Change the target framework.
But if you want to use it in Visual Studio 2008 (the URL of your question suggests it), then:
Open the sln file with notepad, and change the following line:
Microsoft Visual Studio Solution File, Format Version 11.00
to:
Microsoft Visual Studio Solution File, Format Version 10.00
The easiest way is to create a new Visual Studio 2008 project with your requirements (.NET version, namespace, etc) and just copy all sources from your Visual Studio 2010 project to that project. The solution explorer has an option that shows all files in your project that are not included, and you can include these files in your project by right clicking on the files and selecting "Include in project." Then just compile and see what problems you get.
Use the "Properties" from the project and select the version of the framework in "Target Framework"; that is required.
精彩评论