Where do I look to see which .NET framework version I'm targeting in VS 2005 in a C++/CLI project?
EDIT: Sorry, forgot to mention this was a C++/CLI project.
Does it show it somewhe开发者_如何学JAVAre or does it just target one by default?
Also, can you change this in VS2005 or was this new to the later VS versions?
You are targeting the .NET Framework 2.0 runtime. This is the only supported one in Visual Studio 2005 and the setting cannot be changed.
Note that you can use the additional libraries from .NET 3.0 with Visual Studio 2005 if they are installed.
Visual Studio 2008 has been the first version of Visual Studio allowing to target multiple framework versions.
VS2005 doesn't support targeting, it is up to you to pick the assemblies you add as references wisely, your program will ask for the V2.0 CLR.
VS2008 supports choosing between 2.0, 3.0 and 3.5. This is a simple trick, it just hides assemblies that are not available in an earlier version so you can't add them. Your program will still ask for the V2.0 CLR, the CLR version for all three versions of the framework.
VS2010 targets the V4.0 CLR by default. You can target earlier versions but there's a problem with that. The build system was radically changed, switching to MSBuild instead of the legacy C/C++ builder. You can only target an earlier version if you also have VS2008 installed on your machine. Projects that you import from an earlier VS version require editing the .vcxproj file by hand to get them to target an earlier .NET version. A fair amount of pain here, not sure what's in store for SP1.
精彩评论