Sunday, December 11, 2011

"Building Multiple TargetFramework Version Libraries" - One code base, multiple targeted .Net Versions, lots of lessons learned...

MSDN Code Gallery - Building Multiple TargetFramework Version Libraries

Imagine you want to create a library that supports different versions of .NET. Of course there are multiple ways to do this but this is the technique that I have adopted for my CodePlex projects.

My Requirements Are

  • Build for .NET 4.0.0, .NET 4.0.1 and in the future .NET 4.5
  • Have one set of source files for all releases
  • Works well with MSBuild keeping each version separate in obj and bin folders
  • Works well with tools like Resharper, StyleCop etc.
  • Handles version specific app.config / web.config files
  • Target framework and build configuration are easy to see in Windows Explorer file properties with debug builds

...

image..."

The number of lessons learned covered in the article makes it a great resource if you need to target different .Net Framework versions...

No comments: