.net 3.5 compatibility

Aug 13, 2012 at 4:20 PM


I see several commits to have .Net 3.5 compatibility. Ex: http://pstsdknet.codeplex.com/SourceControl/changeset/64936fcb2fc6

I don't have .Net 4.0 on my server, I can't use it.
But with the current trunk, I can't compile for .Net 3.5.

With MSBUILD from VS2010, it uses by default "Toolset=v100", so it builds correctly, but targeting .Net 4.0.
With MSBUILD from VS2008, it doesn't build. I have to change some includes to use Boost:

//#include <memory>
#include <boost/tr1/memory.hpp>
Is it normal to change the source code to make it build with .Net 3.5? Or am I missing something (set a variable? I can see some #ifdef __GNUC__ but it doesn't use Boost

Maybe there is a downside to my solution? (using Boost instead of std from toolset=v100 ?)


Aug 16, 2012 at 10:58 PM

All projects and solutions are VS2008 files.  They all target the 2.0 runtime (some the 3.5 framework).  If you open it in VS2010, it will change the toolset version to 10.0, which builds for .NET 4.0.  To build in Visual Studio 2010, targeting .NET 3.5, you have to set the "Platform Toolset" setting from V100 to V90 (possibly by editing the project file).  You would also need VS2008 installed for it to work.  You also might be able to use the Windows SDK (a version greater than v6.1) to build it for .NET 3.5 if you set the platform toolset appropriately for that, but I'm not sure.

To compile in VS2008, it requires both SP1 (for the TR1 support), which might be why you're having trouble building it.

It's also possible that if you installed the Windows SDK after you installed SP1 for VS 2008, it might have broken TR1 support (this is a known issue, if I remember correctly).  It might be able to be fixed if you do a repair install of SP1.  The Windows SDK 6.1 does not include TR1 support for C++.