Ever since I went to the Tulsa TechFest last October, I've stayed in touch with Sean Whitesell, an application developer at AAON Inc. Last night he sent me an IM that he just upgraded a .Net 1.1 app to .Net 2.0 very quickly and painlessly. I asked him to write about his experience and here it is:
Well today is the day. I finally decided I'd try to upgrade my large eCommerce package from .NET 1.1 to as high as I could go. Heck I just decided I'd try 3.5 for the fun of it. My eCommerce package was a purchased framework that I have molded for the last few years to fit our company's business rules, ongoing changes, etc. I say it's a large package but it only serves a select group of people so we only get about 40 to 50 orders per day. It's great for us since it cut down the phone calls into our parts department dramatically. Our customers no longer have to wait on hold just to order replacement stock items or other items of which they already know the details.
A few months ago I got a seperate computer so I could run two seperate environments of this package. Although .NET versions work ok with each other, some COM objects don't. I use a few that are provided by third party vendors. One of which is for our address scrubbing process. I validate the shipping address and get the Zip+4 which I later pass to our tax system. It then knows the difference in taxes if you are in or out of city limits, etc. So, I copied all the files to the other computer. I opened Visual Studio 2008 planning on attacking each issue one at a time. What I got was the Conversion Wizard. I knew it would come up but I didn't know how well it would work. It complianed about the files being under source control. It was on the source machine so I didn't worry about it here. I let it delete the source control bindings. Basically it gets rid of the SourceSafe files in each directory and clears the Read-Only flag on the files, plus cleans the project file. Only a few minutes later and it's done.
Great! I didn't know if it would take minutes, hours, or even days.
The project was open in Visual Studio. I looked in the References for items it didn't find that needed to also be copied over. I had a few.
I wrote some custom Dll's to handle freight estimating. Although their Dll's were copied in the Bin directory of the main project, the projects needed to be moved to keep the solution together. So I rebuilt the solution with the side projects.
Next, I had to go through the errors when I tried to build the project. I found that all the control declarations, required by .NET 1.1, were moved to the designer files. Another major plus found with the Conversion Wizard. I did find a few that had to be declared by hand since they were not included in the designer file. I found quickly that although I could add a control declaration in the designer file, the file was rebuilt each time I compiled. Thus I had to make the declarations in the .vb or .cs files. There only two or three I had to do this to. Then I found several items that needed to be properly defined. There are several places I used Context.Session and had to be replaced with System.Web.HttpContext.... Fine by me, it just adds a guarantee that the right object is being used. I then also found several Mail objects that had to be moved from Web.Mail, which has been deprecated, to System.Net.Mail. I quickly learned the differences and the modifications were made.
I finally got a build that compiled without errors but still had a lot of warnings. I ran the project to see how well it really works. I had to make a few changes in IIS since it was not properly setup. I had to create the IIS application and add the default.aspx tag in the
documents area. Great, it works! I was able to login and place a
few test orders.
I decided then to work on a few warnings to see what all it is fussing about. I found that since I'm using XHTML 1.0 Transitional that a lot of items did not meet their standards. So, I set out to work on a few.
There were many string declarations that were not created properly.
They work but they could allow for a null reference. IE; Dim foo as
string should be Dim foo as string = "" Plus, there were a lot of
unused variables. Obviously good to get out.
I still have some work to do to get all the warnings out, but I have a working product. I even started changing out datagrids for gridviews.
I'm very pleased with the progress especially since I was able to do all this in just one day's time.