แชร์ผ่าน


Walkthrough: Converting a Visual Studio 2005 Web Site Project to a Visual Studio 2008 Web Site Project

This walkthrough describes how to convert a Visual Studio 2005 Web site project to a Visual Studio 2008 Web site project. If you want to work in Visual Studio 2008 with a Web site that was created in Visual Studio 2005, you can just open the Web site. Visual Studio 2008 prompts you to upgrade the .NET Framework version that the Web site targets. If you decide not to upgrade, the Web site opens in Visual Studio 2008 and there is no additional conversion. If you decide to upgrade, you can follow the conversion process in this walkthrough.

This walkthrough demonstrates the following tasks:

  • Opening a Visual Studio 2005 Web site in Visual Studio 2008.

  • Upgrading the .NET Framework version that the Web site targets.

  • Testing the project.

Prerequisites

To complete this walkthrough, you will need:

  • Visual Studio 2008.

  • A Web site that was created in Visual Studio 2005 that compiles and runs without errors.

Converting the Web Site

To begin, you open the Web site in Visual Studio 2008, which starts the conversion.

To open the Web site

  1. In Visual Studio 2008, in the File menu, click Open and then click Web Site.

    The Open Web Site dialog box is displayed.

  2. Browse to the folder that contains the Web site project file, and then click Open.

    Visual Studio 2008 displays what version of the .NET Framework the Visual Studio 2005 Web site targets. It prompts you to upgrade the project to use the .NET Framework 3.5.

  3. Click Yes.

    Visual Studio updates the .NET Framework version. It also updates any .NET Framework version-specific information in the Web.config file.

    Note

    You can change these version settings manually after the conversion.

  4. In Solution Explorer, right-click the Web site's project node, click Property Pages, and then click Build settings.

    The build settings are displayed.

  5. Verify that the target version of .NET Framework is set to the .NET Framework 3.5. If it is not, select the correct version of the .NET Framework from the list.

    Click OK to close the project property pages.

Testing the Project

After the upgrade, 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 Web site compiles and 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. In the Build menu, click Build Web Site.

    Any missing references or other compilation issues in the project are displayed in the Error List window.

  3. On the Debug menu, click Start Debugging.

    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.

    The Script Debugging Disabled dialog box might also be displayed. This indicates that script debugging is disabled in Internet Explorer. To enable debugging for client script, follow the directions in the dialog box.

    Click Yes to continue debugging.

  4. Verify that the project runs as expected.

Next Steps

If you want to convert a Visual Studio 2005 Web site that contains AJAX features to Visual Studio 2008, the overall process is similar but requires additional steps. After converting the Visual Studio project, perform the steps that are described in How To: Upgrade an ASP.NET AJAX 1.0 Web Project to .NET Framework 3.5..

You might want to convert other types of projects from earlier versions of Visual Studio to Visual Studio 2008. For more information, see Overview: Converting Visual Studio Web Sites and Projects to Visual Studio 2008.

See Also

Tasks

How To: Upgrade an ASP.NET AJAX 1.0 Web Project to .NET Framework 3.5

Walkthrough: Converting a Visual Studio 2005 Web Site Project to a Visual Studio 2008 Web Application Project

Walkthrough: Converting a Visual Studio 2005 Web Application Project to a Visual Studio 2008 Web Application Project

Concepts

Overview: Converting Visual Studio Web Sites and Projects to Visual Studio 2008

.NET Framework Targeting for Web Sites

Migrating and Converting ASP.NET Web Sites