Visual Studio 2008 Dual compile – Education Career Blog

I have a project that i want to compile for 2.0 and 3.5 is there any way to do this in vs 2008?


Yes. You can use conditional references and things like that. Marc Gravell set this up for the MiscUtil project – the best way to find out how to do it is probably to download the source and have a look. We use C# 3.0 features, so it’s only compatible with Visual Studio 2008, but we have build configurations for .NET 2.0 and .NET 3.5, so it’s just a case of changing the current build to check that things still work. (The release scripts build both versions, of course.)


Code compiled for 2.0 will run under 3.5. If you’re not using any of the new features of 3.5 (and you’re not, otherwise you couldn’t compile to 2.0) then there’s no pressing reason to compile against it.

Leave a Comment