Converting a Visual Studio 2003 Web Project to a Visual Studio 2008 Web Application Project

Posted by navaneeth on Geeks with Blogs See other posts from Geeks with Blogs or by navaneeth
Published on Mon, 31 May 2010 03:51:36 GMT Indexed on 2010/05/31 22:03 UTC
Read the original article Hit count: 1165

Filed under:

This walkthrough describes how to convert a Visual Studio .NET 2002 or Visual Studio .NET 2003 Web project to a Visual Studio 2008 Web application project. The Visual Studio 2008 Web application project model is like the Visual Studio 2005 Web application project model. Therefore, the conversion processes are similar. For more information about Web application projects, see ASP.NET Web Application Projects.

You can also convert from a Visual Studio .NET Web project to a Visual Studio 2008 Web site project. However, conversion to a Web application project is the approach that is supported, and gives you the convenience of tools to help with the conversion. For example, when you convert to a Visual Studio 2008 Web application project, you can use the Visual Studio Conversion Wizard to automate part of the process. For information about how to convert a Visual Studio .NET Web project to a Visual Studio 2008 Web site, see Common Web Project Conversion Issues and Solutions.

There are two parts involved in converting a Visual Studio 2002 or 2003 Web project to a Visual Studio 2008 Web application project. The parts are as follows:

 

Note

You can change a project's .NET Framework version manually. To do so, in Visual Studio open the property pages for the project, click the Application tab, and then select a new version from the Target Framework list.

This walkthrough illustrates the following tasks:

Prerequisites

   

To complete this walkthrough, you will need:

Converting the Project and Upgrading the .NET Framework Version

   

To begin, you open the project in Visual Studio 2008, which starts the conversion. It offers you an opportunity to back up the project before converting it.

Note

It is strongly recommended that you back up the project. The conversion works on the original project files, which cannot be recovered if the conversion is not successful.

To convert the project and back up the files

  1. The Open Project dialog box is displayed.

  2. Browse to the folder that contains the project or solution file for the Visual Studio .NET project, select the file, and then click Open.

Note

Make sure that you open the project by using the Open Project command. If you use the Open Web Site command, the project will be converted to the Web site project format.

  1. The Conversion Wizard opens and prompts you to create a backup before converting the project.
  2. To create the backup, click Yes.
  3. Click Browse, select the folder in which the backup should be created, and then click Next.
  4. The backup starts.

Note

There might be significant delays as the Conversion Wizard copies files, with no updates or progress indicated. Wait until the process finishes before you continue.

When the conversion finishes, the wizard prompts you to upgrade the targeted version of the .NET Framework for the project.

  1. It is recommended that you leave the check box selected that asks whether you want to upgrade all Webs in the solution.

    If you upgrade to .NET Framework 3.5, the project's Web.config file is modified at the same time as the project file.

    When the upgrade and conversion have finished, a message is displayed that indicates that you have completed the first step in converting your project.

  2. The wizard displays status information about the conversion.

  3. Click Close.

Testing the Converted Project

   

After the conversion has finished, you can test the project to make sure that it runs. This will also help you identify code in the project that must be updated.

To verify that the project runs

  1. If you know about changes that are required for the code to run with the new version of the .NET Framework, make those changes.
  2. Any missing references or other compilation issues in the project are displayed in the Error List window. The most likely issues are missing assembly references or issues with dynamically generated types.

  3. In Solution Explorer, right-click the Web page that will be used to launch the application, and then click Set as Start Page.
  4. If debugging is not enabled, the Debugging Not Enabled dialog box is displayed. Select the option to add a Web.config file that has debugging enabled, and then click OK.

  5. Do not continue with the conversion process until all build and run-time errors are resolved.

Converting ASP.NET Code Files

   

ASP.NET Web page files and user-control files in Visual Studio 2008 that use the code-behind model have an associated designer file. The files that you just converted will have an associated code-behind file, but no designer file. Therefore, the next step is to generate designer files.

Note

Only ASP.NET Web pages and user controls that have their code in a separate code file require a separate designer file. For pages that have inline code and no associated code file, no designer file will be generated.

To convert ASP.NET code files

  1. The files are converted.

  2. Verify that the converted code files have a code file and a designer file.
  3. Build and run the project to verify the results of the conversion.

© Geeks with Blogs or respective owner