title: What's the best way to target multiple versions of the .NET framework?
body: <p>I'm building a class library and I will deploy it a NuGet package, which lets me choose different assemblies to be added as references based on the .NET framework version of the project it's added to. This is a very nice feature, but what I'm wondering is whether it is possible to have a single class library project, and build it against mulitple versions of the .NET framework?</p>
  
  <p>I'd rather avoid having:</p>
  
  <p><code>MyLibrary40.dll</code> and <code>MyLibrary45.dll</code></p>
  
  <p>if possible, because the two projects would have to share a lot of code. The 4.5 version will be offering <code>async</code> functions, which is a 4.5 feature.</p>
  
  <p>Does anyone know what the best approach for this is? Can I use multiple build configurations? Or must I go down the separate project route?</p>
  
  <p>If I was working in C++ I'd probably use multiple configurations and <code>#if</code> blocks around the functions that are only supported in one configuration, but I worry this would lead to me having two assemblies with the same name that do different things.</p>
  
  <p>Thanks in advance!</p>