Managed C++ and Visual Studio 2008/2010
For people who write Managed C++ code (C++ code that take advantage of .NET and loads into the CLR), you may want to hang onto your Visual Studio 2008 install even when installing Visual Studio 2010. This is because when a pre-2010 Visual Studio C++ project file (vcproj) is updated to 2010 project file (vcxproj) it automatically “targets” .NET 4.0. This is ignored for unmanaged C++ projects, but for managed C++ projects it means that you can only exist on a system with .NET 4.0 installed. .NET 4.0 is not ubiquitous yet, so I don’t recommend targeting it.
To target .NET 3.5 for your Managed C++ code you actually have to hand-edit the project file. This isn’t hard, just follow the instructions here as posted on stackoverflow.
The kicker is that while C# and VB.NET projects can target any version from 2.0 of the .NET framework and greater with just the tools provided by the .NET Framework, C++ code, managed or unmanaged, needs tools only shipped with the appropriate version of VS. This means that when you target .NET 3.5 for your managed C++ code, even when building with VS 2010, it requires VS 2008 to be installed so the appropriate linker, manifest generator, etc. binaries are installed.
REMEMBER, this issue only affects managed C++ code. Even though unmanaged C++ projects say they target the .NET 4.0 Framework, it is of no consequence.
Hope this helps!
Filed under: software development | Leave a Comment
Tags: .net, .net 3.5, .net 4.0, c#, visual studio, visual studio 2008, visual studio 2010
No Responses Yet to “Managed C++ and Visual Studio 2008/2010”