.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.)

Answer:   https://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/netfxcompat.asp

 

Application type

Computer with 1.1

Computer with 2.0

Computer with 1.1 and 2.0

1.1 stand-alone application (Web or Microsoft Windows client)

Loads with 1.1

Loads with 2.0

Loads with 1.1

2.0 stand-alone application (Web or Microsoft Windows client)

Fails

Loads with 2.0

Loads with 2.0

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:

https://msdn.microsoft.com/netframework/programming/breakingchanges/default.aspx

 

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:

https://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/netfxcompatapptest.asp?frame=true

 

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:

  1. https://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/sidexsidenet.asp?frame=true
  2. https://blogs.digineer.com/blogs/tabraham/archive/2005/12/09/15.aspx

 

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):

https://www.microsoft.com/downloads/details.aspx?familyid=7cecd652-fc04-4ef8-a28a-25c5006677d8&displaylang=en

 

Next, check out the following two whitepapers for guidance on what to do before and after migrating:

  1. Step-by-Step Guide to Converting Web Projects from Visual Studio .NET 2002/2003 to Visual Studio 2005 – This one walks you through all of the things you should do to your 1.1 application in VS 2003 to prepare it for the migration before you open it in VS 2005.
  2. Common ASP.NET 2.0 Conversion Issues and Solutions – This one has information to help out with issues you can run into after the conversion.  However, also read this one before to understand what you'll be getting into. 

 

ASP.NET Migration Option #2 :

 

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:

https://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx

 

But before you use it, be sure to read through Scott Guthrie’s most excellent post on how to use it here:

https://weblogs.asp.net/scottgu/archive/2006/05/08/445742.aspx

 

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:

.NET 1.1 to .NET 2.0 Migration PPT

 

Thanks Doug for putting the PPT together!