Visual Studio 2010 has this great ability to target multiple versions of the .NET Framework. However, as invaluable as that feature is, it has caused me problems multiple times in the past couple of weeks. Admittedly, the problems are really caused by me not paying attention, but it’s much easer to blame the tool than the developer!
Last time I had a problem with the multi-targeting ability of VS 2010 was when I couldn’t find the MEF assemblies. This time, the problem was that I was getting a completely different project template for a Windows Azure Web Role than I expected. I am working on content Windows Azure course, and all of a sudden my demo projects were coming up with a different project template for my Web Roles. Turns out, it was the Target .NET Framework again.
If you have Visual Studio 2010 targeting the .NET Framework when you create a Windows Azure Project as follows:
You can see that the role project templates are then also .NET Version specific…
And then the project that get’s created for the .NET 3.5 Web Role, is a mostly empty ASP.NET Website….
The same sequence for .NET Framework 4.0 however yields:
Some day, maybe I’ll learn my lesson and pay attention in the darn new project dialog.