Partager via


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

Comments

  • Anonymous
    May 11, 2006
    Last night, when I showed up at the Northern Jersey UG, it turned out that the featured speaker wasn’t...

  • Anonymous
    May 11, 2006
    Great post by Peter here on some of the considerations when moving your applications. A definite good...

  • Anonymous
    May 11, 2006
    Great bunch of resource.

    What about migrating old ASP apps to 2.0? Only piece missing.

    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.

  • Anonymous
    May 15, 2006
    PingBack from http://www.ellisweb.net/2006/05/items-of-interest-20060516/

  • Anonymous
    May 15, 2006
    Peter (my counterpart in the New York / New Jersey district) posts an excellent FAQ on migrating appplications...

  • Anonymous
    May 16, 2006
    The following links to .NET resources have been collated over time with the assistance of colleagues. ...

  • Anonymous
    May 17, 2006
    Peter Laudati has an excellent post discussing the ins and outs of getting code across from 1.1 to 2.0. ...

  • Anonymous
    May 17, 2006
    I've recently met a number of web developers who are working with ASP.NET 1.1 and are keen to move or...

  • Anonymous
    June 19, 2006
    Last month, I wrote a post about migrating .NET 1.1 applications to .NET 2.0.  My colleague Doug...

  • Anonymous
    June 19, 2006
    jvierra,

    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.

    However, I did dig up this on on "classic" to 2.0:
    http://msdn.microsoft.com/asp.net/reference/migration/asp2mig/default.aspx?pull=/library/en-us/dnvs05/html/migratingtoaspnet2.asp

    -Peter (aka JrzyShr Dev Guy)

  • Anonymous
    June 19, 2006

    Well its a very common question that gets asked all the time. How does one migrate from .NET 1.1 to...

  • Anonymous
    July 25, 2006
    You've been kicked (a good thing) - Trackback from DotNetKicks.com

  • Anonymous
    December 19, 2006
    The comment has been removed

  • Anonymous
    March 15, 2007
    Can i use the same virtual directory to host asp.net 1.1 and 2.0 pages and specify the framework version at the page level?

  • Anonymous
    March 31, 2007
    PingBack from http://fernandof.wordpress.com/2007/04/01/encryption-license-issues-when-upgrading-from-net-11-to-net-2/

  • Anonymous
    April 02, 2007
    @Nishanth - Unfortunately, you can not host both 1.1 & 2.0 pages in the same virtual directory and specify framework version at the page level.  Framework version is set at the application level... which by default translates to the virtual directory level. While the framework version is captured in the config files, it is actually a setting you manipulate in the IIS web server's settings at the Virtual Directory level. -Peter (aka JrzyShr Dev Guy)

  • Anonymous
    May 02, 2007
    A while back, I wrote about migrating from .NET 1.1 to .NET 2.0 . I wrote that post almost a year ago,

  • Anonymous
    May 07, 2007
    Ok... trying to search for this and very little answers seem to avail. Is it possible for the 'converted' .NET 2.0 application to still use .NET 1.1 binaries?

  • Anonymous
    May 09, 2007
    @Jason, The answer is... it depends.  When you run your newly "converted" .NET 2.0 assemblies, they will ALWAYS run against the .NET 2.0 Framework.  That also means that any assemblies they link to will also run under the .NET 2.0 Framework.  This includes those 1.1 assemblies. Now, the question becomes, will those 1.1 assemblies run under the 2.0 Framework?  I refer you back to the content in this post.  2.0 is mostly backwards compatible with 1.1.  You need to test test test!  If the 1.1 assembly doesn't use any features that changed in 2.0, then it should run fine.  One of the links above shows what those breaking changes are to help you troubleshoot. However, given that you say you 'converted' your assemblies to 2.0, I'm assuming that you don't control or own the 1.1 assemblies you mention.  If so, and the 1.1 assemblies refuses to load in 2.0, then you're out of luck. -Peter

  • Anonymous
    June 12, 2007
    Its a good article and I successfully converted my .Net 1.1 code to 2.0.  I am facing an issue with CDate function in my code. It is showing the following error: "System.InvalidCastException was unhandled by user code  Message="Conversion from string "7/30/2003" to type 'Date' is not valid." anybody please help by telling what is the equivalent method in VB.Net 2005 for CDATE?

  • Anonymous
    September 30, 2007
    Migrating from .NET Framework v1.x to Visual Studio 2008

  • Anonymous
    October 30, 2007
    There are numerous API changes on .net framework 2.0 compare to .net framework 1.1. http://msdn2.microsoft.com/en-us/netframework/Aa570326.aspx

  • Anonymous
    November 09, 2007
    PingBack from http://seregaborzov.wordpress.com/2007/11/09/net-1-to-net-2/

  • Anonymous
    February 01, 2008
    PingBack from http://nomisit.wordpress.com/2007/10/31/installing-net-20-framework-on-existing-v11-servers/

  • Anonymous
    June 19, 2009
    PingBack from http://debtsolutionsnow.info/story.php?id=5566