.NET 1.1 to .NET 2.0 Migration

I can’t tell you how many times I get customers that ask me questions about migrating from .NET 1.1 to 2.0.The topic came up at Tuesday night’s N3UG meeting.It’s an important topic, and Microsoft probably doesn’t do as good of a job as they could in getting the word out about 1.1 to 2.0 migration.Hopefully the links I have included in this post will help out as a starting place for folks looking into how much work it will take to migrate from 1.1 to 2.0.

The most frequently asked question that typically starts this conversation is:

Question #1: “How much work will it take to move from 1.1 to 2.0 and how long will it take?”

Answer: The answer is “It depends”.Some applications move over with the simple click of a button, and others take a little more work than that.

I usually respond by asking another question:

Question #2: “Do you need to migrate at all?”

Answer: If it is an application that is still “alive” and moving forward, then the answer is “Yes, you should migrate.”Skip below to Question #4.If you have a 1.1 application that is working just fine, and you don’t plan on modifying/updating it, leave it as it is and it should work just fine side-by-side. (As they say, "if it ain't broke, don't fix it.") That usually leads to this question:

Question #3: What happens when you load/run a .NET 1.1 application on a machine that has both 1.1 and 2.0 installed? (ß Actually, this question can be asked in multiple permutations as you will see by the answer.)

1.1 add-in to a native application (such as Office or Internet Explorer)

Loads with 1.1

Loads with 2.0

Loads with 2.0 unless the process is configured to run against 1.1

2.0 add-in to a native application (such as Office or Internet Explorer)

Fails

Loads with 2.0

Loads with 2.0

Given that .NET was designed for side-by-side version operation since it first came out, that 1.1 application should run fine in a side-by-side environment.It’s the scenarios in bold that you need to really pay attention to with regards to testing.As this blog post notes, what will catch folks off-guard are the scenarios in the third row in the table.The gotcha is that you might not even be aware of what applications cause the third row scenarios.

The 2.0 framework is mostly backwards compatible with the 1.1 framework.Meaning, most 1.1 applications should run okay on the 2.0 framework.Therefore, the scenarios in bold should work out for you most of the time if you choose not to migrate your 1.1 application forward.But (and there is always a ‘but’), there are some breaking changes in the 2.0 framework.

Here’s where you can find out about breaking changes in the 2.0 Framework.Use this list ahead of time to analyze your 1.1 application and anticipate where issues might crop up:

Then, once you have a heads up on what could go wrong, test out the scenarios in the matrix where your 1.1 application could be loaded using the 2.0 framework. Here are some test scenarios to consider:

If your 1.1 application fails to run on 2.0 for whatever reason, and you still need to support the scenario in the last column of the third row, you can make some configuration changes to force the application to run using the 1.1 framework.Check these two links for more information:

Okay… still with me?!By now, you’ve got all of the steps needed (I hope) to determine how your .NET 1.1 application will work on machines that have only the 2.0 framework installed,and machines that have both versions of the framework installed.

That brings us to frequently asked question number four:

Question #4:Okay, I want to migrate my application from .NET 1.1 to .NET 2.0.Where do I start?

The quick and dirty answer:Back up your VS 2003/1.1 solution first!!!Then, open your Visual Studio 2002 or 2003 project/solution in Visual Studio 2005.A conversion wizard will convert the project/solution to 2005.Compile the code, and you will now have a .NET 2.0 application!

The real answer:If you’re migrating a Windows Forms application, the majority of times, the quick and dirty answer above will be all it takes for you!If you’re migrating an ASP.NET web application, you should do a little homework before you open your .NET 1.1 project/solution in Visual Studio 2005.

Let’s talk about non-web applications first.As I mentioned, most of the time, opening the application in Visual Studio 2005 and running it through the conversion wizard will be all it takes.This will merely update the project files (.vbproj/.csproj) to work with 2005.It will not update your application code to take advantage of the new .NET 2.0 features.At this point, when you compile your existing 1.1 code, it will be compiled against the 2.0 framework.If the code doesn’t compile, check out the list of breaking changes in the 2.0 framework I mentioned above and begin troubleshooting from there.

For migrating web applications, there can be more work involved since the project model for web applications has changed greatly in Visual Studio 2005.Fortunately, the ASP.NET team has done a decent job of organizing all of their migration information in a central location.First, go here to the ASP.NET migration center on MSDN.

As of just this week (8th of May), there are now TWO options for migrating an ASP.NET 1.1 application to 2.0!For the first option read on.For the second one (which just came out and I think will make everyone’s lives much easer), skip to the bottom.

ASP.NET Migration Option #1:

From the ASP.NET migration center, download the updated conversion wizard for Visual Studio 2005.They released this in December, about a month after Visual Studio 2005 came out (it fixes some key issues with the conversion wizard that ships with VS 2005):

Due to all of the feedback received from customers with regards to option #1, the ASP.NET team responded (just recently) with a new way to migrate forward.The biggest hang up with migrating to VS 2005 is that web applications use a new project model.Most of the issues with the existing conversion wizard involved things getting messed up when the wizard tries to move files/classes/etc from the old model to the new model.(A conversion wizard is no match for the creative ways folks have organized their ASP.NET code in VS 2003. J)

A new Web Application Project template for VS 2005 has been released by the ASP.NET team.This project template basically uses the same model as the previous VS 2003 project type.You can download the new template here:

And there you have it…those are my answers to the FAQ’s I usually receive concerning .NET 1.1 to .NET 2.0 migration.Did I get anything wrong?Did I miss any other common gotchas that you have experienced?Let me know down in the comments.

[Updated] My colleague Doug Tunure from the Atlanta area recently compiled a Power Point presentation together based on the information from this blog post. This should make for a handy reference when needing to share migration information with management. You can download the presentation here:

We learned that changing the extension to aspx and adding a page directive was necessary.

I have discovered that Frontpage 2000 HTML pages are the worst due to the default settings in 2005 for code validation. Changing just teh tag termmination error reporting solves the largest number of errors.

Fronntpage puts in an attribute "fprollover" or the like in the BODY statement and elsewhere in the page.

What is the recommended solution for this. What abount extending the DTD through the web.config file or something like that.

Someone at MS has probably already documented al lof this although I didn't see it with VS 2003 or before. I don't remember 2003 complaining as much as 2005 does either.

I agree that some "classic" ASP to ASP.NET 2.0 migration info would be nice to have. Although, moving from "classic" ASP to .NET is pretty much a topic on to itself. There's a lot of great information out there about moving from "classic" to 1.0/1.1. Much of that information is still valid.