Opening VS2k5 .Net 2.0 projects in VS2k8

I’m starting a new gig right now and one of the sweet things about it is that I’m going to be working in .NET 3.5 straight off the bat. Hopefully I’ll have some more time to blog about things to do with the framework and the language over the next number of weeks.

Because of the normal process that most companies seem to have for assimilating new people to a team, I spent a couple of days with no direct network access. Instead of just reading the documentation, I wanted to get some code written so that I could start handing it off to the other team members and training them up on the code architecture that I envision. My only option for writing code was my Visual Studio 2005 .NET 2.0 laptop which handily did the trick. Once I got my network access I quickly moved my source files over to the other machine (actually a VPC) and fired up Visual Studio 2008 to make sure everything was still kosher.

When it compiled on the first try I immediately set out to change some of my initial code to use the basic language features that are new in VS2k8. I went through the DTOs that I’d built and changed all to use the simple property syntax. Again everything compiled just fine. I was on a roll.

For some reason I ended up in the project properties window today and I noticed that the project (one that I’d moved up from VS2k8) was still using .NET 2.0. It’s a simple combobox selection to change to .NET 3.0, but it isn’t done automatically when the solution conversion routine is run. All projects need to be changed manually. You don’t notice that this has happened because VS2k8 has some sweet compiler sugar that allows you to use the new language features in .NET 2.0, 3.0 or 3.5.

When I give my talk on the new language features that are available in VS2k8, I usually give some warning about things like a lack of readability because of the ‘var’ type or that extension methods are probably going to be over used or used in a dangerous way. I never thought that I’d get pinched by that feature that I have lauded over and over. Apparently poor OO and coding practices aren’t the only thing that will be causing people problems when they move their VS2k5 projects up to VS2k8.