开发者

Targeting multiple framework versions in Visual Studio 2010

What is the best practice for developing a shared class library in Visual Studio 2010 to be used by a .NET 3.5 app and a 4.0 app?

I could do it with separate project/solution files, one for 3.5 and one for 4.0 i.e. MyProject.3.5.csproj and MyProject.4.0.csproj but then I need to keep the files in sync. Is there a better wa开发者_JS百科y?


You can create a project in 3.5 framework and use it to create Dlls for to be used in either 3.5 or 4.0 projects


I think VS can have different projects targeting different versions of .NET Framework in the same Solution without trouble. Create an empty solution (it doesn't matter which framework version you use) then add the corresponding projects (here is where you choose the correct version of .NET framework for each of your projects).

If you have a solution already, you can change the targeting version of any of your projects in the solution by going into the project properties and changing the target version of .NET Framework there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜