Home > Microsoft .Net Development Tips > ASP.NET Development > ASP.NET 1.x to ASP.NET 2.0 migration in five steps
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ASP.NET DEVELOPMENT

ASP.NET 1.x to ASP.NET 2.0 migration in five steps


Brian Eastwood, Site Editor
06.28.2006
Rating: --- (out of 5)


Office Development Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


The out-of-the-box ASP.NET migration tool in Visual Studio 2005 is the Web Site Project, which is based on the dynamic compilation model. Microsoft learned shortly after the release of VS 2005 that the Web Site project required some manual code fixes and was a bit cumbersome for large Web projects.

To that end, Microsoft released the Web Application Project in May 2006. This is based on the client project model, and it compiles into a single assembly while allowing multiple configurations, said Omar Khan, group program manager for Visual Studio Web Tools.

The Web Application Project, or WAP, was included in Visual Studio 2005 Service Pack 1. Microsoft's Visual Studio 2005 Web Application Projects page provides information on what developers should do if they have not installed VS 2005 SP 1 or still have the separate WAP add-on.

Though developers could update a Web application's script map to ASP.NET 2.0 and still develop using Visual Studio 2003, Khan said Microsoft recommends migrating using WAP. "We definitely feel this is the path of least resistance, and it gives you all the benefits of ASP.NET 2.0 within the IDE," he continued.

At Tech Ed 2006, Khan provided a five-step process for migrating Web projects from ASP.NET 1.x to ASP.NET 2.0. If a project is error-free in Visual Studio 2003, then a developer can migrate in less than 30 minutes with "very little manual steps required," Khan said.

Make sure the Web Application Project is available. As stated, this was included in Visual Studio 2005 Service Pack 1.

Validate the application in Visual Studio 2003. Open the application in VS 2003, perform a build and validate all projects and page functions. Khan also suggested running the app in the browser to check for errors in ASPX files.
More on ASP.NET migration

ASP to ASP.NET Migration Learning Guide

Microsoft's Web Application Project released

Microsoft updates VS 2005 Web Application Project

This step should solve a common problem on the MSDN forums, where many developers report issues with a migration, only to discover that the cause is, in fact, a flaw in the original code.

Open Visual Studio 2005 and launch the Conversion Wizard. It's best to migrate an entire solution at once, but if you plan to do individual projects, then start with "bottom of the food chain" items like class code and shared libraries, Khan said. Once the wizard has run its course, perform a build.

Errors that may need fixing at this point include in-line VB code in ASPX pages and name collisions. The latter occur when VS 2003 types don't quite fit into the corresponding default namespace in Visual Studio 2005, and they can be remedied by fully qualifying the namespace, Khan said. Once errors have been cleaned up, run the application and validate its functionality.

Convert to partial classes. One of Visual Studio 2005's many new features is partial classes, which separates a developer's code-behind file from the designer file that Visual Studio creates. (These files come together at compile time.) To convert the pages in your application to partial classes, right-click on the root mode of a Web project and select "Convert to Web Application. This will move generated code into a designer.cs or designer.vb file, depending on the language you are using.

As in Step 3, the next task is performing a build and correcting the errors that arise. In this case, Khan said, the error is likely to be a missing control declaration. This can be added to either the designer file or the code-behind file; Khan recommended the code-behind file, since it changes only at a developer's discretion.

Fix up XHTML errors, if desired. In VS 2003, the default validation for a Web application is the IE 6 schema. Developers can leave validation for a migrated application on IE 6 or, through the Tools option, change the validation to XHTML, open the app's individual pages and correct and errors. Khan cautioned that this can be a lengthy process.

As an aside, Khan offered developers one additional consideration. Some types have been deprecated in Visual Studio 2005, meaning the types are fully supported now but will not be in future versions of Visual Studio. During a migration from ASP.NET 1.x to 2.0, a developer may see a set of errors for deprecated classes and recommendations for alternate classes. A fix is not necessary for ASP.NET 2.0, but, Khan said, "you'll definitely run into a point where it won't compile."

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
ASP.NET Development
Dundas Map for .NET kicks up geographic visualization
Return to CodePlex: Into the Sandcastle…
VBScript Tutorial
Use PHP with Visual Studio to create Web sites
Visual Studio Team System Add-ins: Conchango Scrum for Team System and Scrum Dashboard
Visual Studio 2008 and .NET Framework 3.5 SP1 introduces ADO .NET Entity Designer
XAML as an everywhere presentation format
Introduction to Silverlight 1.0: Building your first Silverlight application
Creating custom ASP.NET 2.0 profile providers
Book excerpt: Silverlight 1.0 explained

ASP.NET development best practices
LINQ Learning Guide: LINQ and Web applications
VB code download home page
VB code: File manipulation downloads
Localization practices for .NET 2.0: It's still about the architecture
Creating custom ASP.NET 2.0 profile providers
.NET development in the trenches
Microsoft developers balancing age-old issues, barrage of new technology
SearchVB.com's Podcast Page
Visual Studio 2008 Learning Guide: Web development
Top .NET tips of 2007 (so far)

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
136 browser colors with names  (SearchWinDevelopment.com)
ASP.NET  (SearchWinDevelopment.com)
browser  (SearchWinDevelopment.com)
Document Object Model  (SearchWinDevelopment.com)
domain name  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts