title: How to target multiple versions of .NET Framework from MSBuild?
body: <p>I am improving the builds for an open source project which currently supports .NET Framework v2.0, v3.5, and now v4.0. Up until now, I've restricted myself to v2.0 to ensure compatibility, but with VS2010 I am interested in having real targeted builds.</p>
  
  <p>I'm looking for some guidance on how to edit the MSBuild csproj/sln to be able to cleanly produce builds for each target. I'm willing to have complexity in the csproj and in a batch file to control the build.</p>
  
  <p>My goal is to be able to have a command line script that could produce the builds without needing Visual Studio installed, but only the necessary .NET Framework(s). Ideally, I'd like to minimize dependencies on additional software. I notice that a lot of people use NAnt (e.g. <a href="http://github.com/ninject/ninject" rel="noreferrer">Ninject builds many targets with NAnt</a>) but I'm unsure if this is necessary or if they are just more familiar with it.</p>
  
  <p>I'm pretty sure this can be done but am having trouble finding a definitive guide on setting it up and best practices.</p>
  
  <p><strong>Bonus:</strong> my next step after getting this set up will be to better support Mono Framework. Any help on doing this same thing for Mono would be much appreciated.</p>