A Guide To Migrate from VS 2003 To VS 2005


After the release of VS 2005, most of the applications started to migrate from VS 2003 to VS 2005. I will explain how to convert your solution from VS 2003 to VS 2005. By converting your solution into VS 2005, we are going to get a lot of advantages.

I will specify, new features added to ASP.NET 2.0, C# 2005 and VS 2005.

New features added to C# 2005:

  • Generics
  • Anonymous Methods
  • Iterators
  • Partial Types
  • Nullable Types...

New features added to ASP.NET 2.0:

  • Master Pages
  • Data Source Controls
  • Themes and Skins
  • New Controls
  • Personalization...

New features added to VS 2005:

  • New Text Editor with Advanced features.
  • Separation of Web-designer Generated code.
  • Web-Site Model.
  • XML Editor...

So, in order to use this features we have to convert your solution into VS 2005.

Until now, everything is fine. Before converting your solution into VS 2005 we have to make a decision, whether it is necessary to convert solution or not. My suggestion is its better to convert your solution, if our project requires enhancements frequently. Don't convert your project, if it is already in use by clients and if it wont requires any enhancements further.
            
If you think, it is required to convert your solution into VS 2005 you have to make another decision regarding conversion. The decision is whether to convert your solution into Website model or WAP model. Due to problems occurring in conversion of solution to Website model, Microsoft released WAP model, which is similar to ASP.NET 1.x model. It is almost impossible to convert your solution to Website model, if it is very large in size. So my suggestion is to convert your VS 2003 solution into WAP.

But, you may think that, you can't get features of Web Site model. The only advantage of Website model is easy deployment. Other than that there are no important features in it. So go for WAP(Web Application Project) model.

We can download WAP from here.

Follow these steps to convert your solution into VS 2005:

Step 1:

First, compile each and every project in your solution in VS 2003. Make sure, no errors are there in it.

Step 2:

Next, take a backup of your solution. Make sure your solution is not under VSS(SourceSafe). If it is under VSS, it will automatically checkout your files in VSS and converts it to VS 2005. So, it is better to remove all sourcesafe bindings and do conversion. If conversion is successful, we can add solution to VSS.

I will explain how to remove sourcesafe bindings of your solution. Go to your solution folder and remove all files with this extension *.scc,*.vssscc,*.vsp*.

Next, go to your solution file and edit in notepad. Remove any VSS related keys in it. In most of the solution files, we need to remove GlobalSection, which consists of VSS bindings. If we follow these steps, your solution will not be under the control of VSS.

Step 3:

It is highly recommended to convert entire solution at a time. If you want, you can convert each project into VS 2005. But, I am converting entire solution at a time.

Next, open your solution in VS 2005. It will show a conversion wizard. Follow the steps specified in it. You already taken a backup of your solution so, no need to take it again. If any message like asking to remove VSS bindings comes, just click work without VSS bindings permanently option and click Finish.

It takes few minutes to convert, depending on your solution size(number of projects..).

Finally, it will show an error report. This is useful to resolve issues occurred during conversion. Its better to save this error report and start to solve issues. First solve issues occurred in class libraries. Then, build each and every project in your solution individually.

Fix up XHTML errors also.

If you are using any IE WebControls in your solution, its better to go to VS 2005 Treeview and Menu controls...Because, Microsoft is not providing any technical support for IE Webcontrols in VS 2005. If you have any problems in IE Webcontrols in VS 2005 add this to your web.config file:

<section name="MicrosoftWebControls" type="System.Configuration.NameValueSectionHandler,System,Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</
configSections>

<MicrosoftWebControls>
     <
add key="CommonFiles" value="/webctrl_client/1_0/"/>
</
MicrosoftWebControls>

Make sure your Webcontrols are pointing to proper .htc files.

Finally, if you want to utilize the Partial classes also in your solution, just right-click the project and select "Convert to Web Application". But, there is no great thing in partial classes. The only advantage is many people can work at a time on single class. But, placing definition of a class in multiple places is not a good programming technique. So, it is not required to use Partial classes. Another advantage of Partial classes is it will place web-designer generated code in a separate file.

I hope this will be useful to all.