WEB320 WEB320 Migrating ASP.NET 1.x Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Applications to ASP.NET 2.0 Stefan Schackow Stefan Schackow Program Manager Program Manager Web Platform and Tools Team Web Platform and Tools Team Microsoft Corporation Microsoft Corporation
33
Embed
WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
WEB320WEB320Migrating ASP.NET 1.x Migrating ASP.NET 1.x Applications to ASP.NET 2.0Applications to ASP.NET 2.0
Stefan SchackowStefan SchackowProgram ManagerProgram ManagerWeb Platform and Tools TeamWeb Platform and Tools TeamMicrosoft CorporationMicrosoft Corporation
AgendaAgenda
Migrating from Microsoft ASP.NET 1.X Migrating from Microsoft ASP.NET 1.X to ASP.NET 2.0to ASP.NET 2.0
Microsoft Visual Studio 2003 to Visual Microsoft Visual Studio 2003 to Visual Studio 2005 (RTM)Studio 2005 (RTM)
Migrating from ASP.NET 1.X to Migrating from ASP.NET 1.X to ASP.NET 2.0ASP.NET 2.0
ASP.NET 1.X to ASP.NET 2.0ASP.NET 1.X to ASP.NET 2.0
Goal: Easy to upgrade from V1.1 to Goal: Easy to upgrade from V1.1 to V2.0V2.0
We have minimized breaking changesWe have minimized breaking changes
New migration functionality added New migration functionality added post-post-Beta2Beta2
No OS upgrade requiredNo OS upgrade requiredRuns on Microsoft Windows 2000 & IIS 5.0Runs on Microsoft Windows 2000 & IIS 5.0
Runs on Microsoft Windows XP & IIS 5.1Runs on Microsoft Windows XP & IIS 5.1
Runs on Microsoft Windows Server 2003 & Runs on Microsoft Windows Server 2003 & IIS 6.0IIS 6.0
ASP.NET 1.X to ASP.NET 2.0 Beta 2ASP.NET 1.X to ASP.NET 2.0 Beta 2
ASP.NET 1.1 & 2.0 can be installed on ASP.NET 1.1 & 2.0 can be installed on same machinesame machine
Installing V2.0 on V1.1 server Installing V2.0 on V1.1 server Always Always preservespreserves existing V1.1 mappings existing V1.1 mappings
New MMC tab to easily switch versionsNew MMC tab to easily switch versions
Existing ASP.NET 1.1 applications can Existing ASP.NET 1.1 applications can run on top of ASP.NET 2.0run on top of ASP.NET 2.0
Issue Tracker – V1.1Issue Tracker – V1.1Issue Tracker – V1.1 version running Issue Tracker – V1.1 version running on top of ASP.NET 2.0 post-Beta 2on top of ASP.NET 2.0 post-Beta 2
ASP.NET 1.X to ASP.NET 2.0 Beta 2ASP.NET 1.X to ASP.NET 2.0 Beta 2
Forms AuthenticationForms AuthenticationWorks across both ASP.NET versions Works across both ASP.NET versions
ASP.NET 2.0 uses AES encryption by ASP.NET 2.0 uses AES encryption by defaultdefault
Tweak <machineKey /> to change thisTweak <machineKey /> to change this
Sharing Forms Sharing Forms Authentication TicketsAuthentication Tickets
ASP.NET 1.X to ASP.NET 2.0ASP.NET 1.X to ASP.NET 2.0
New ASP.NET reserved directory names New ASP.NET reserved directory names (App_)(App_)
New naming convention for protecting directoriesNew naming convention for protecting directories
Avoid naming directories with this prefix Avoid naming directories with this prefix
ASP.NET Reserved directoriesASP.NET Reserved directories/Bin – Reserved for assemblies. /Bin – Reserved for assemblies. Same as 1.0 & 1.1Same as 1.0 & 1.1
/App_Code – Reserved for code/App_Code – Reserved for code
/App_Data – Reserved for data (*.mdf, .xml, etc.)/App_Data – Reserved for data (*.mdf, .xml, etc.)
/App_Themes – Reserved for theme files (.skin)/App_Themes – Reserved for theme files (.skin)
/App_WebReferences – Reserved for .wsdl files/App_WebReferences – Reserved for .wsdl files
/App_LocalResources – Reserved for local page resources/App_LocalResources – Reserved for local page resources
/App_GlobalResources – global resources/App_GlobalResources – global resources
ASP.NET 1.X to ASP.NET 2.0ASP.NET 1.X to ASP.NET 2.0
XHTML complianceXHTML complianceXHTML compliant markup is now emitted XHTML compliant markup is now emitted by default by default
Good for standards compliance, but can Good for standards compliance, but can break some UIbreak some UI
<xhtmlConformance mode=“”/> <xhtmlConformance mode=“”/> Defaults to mode=“Transitional”Defaults to mode=“Transitional”
Can set mode=“Legacy” or “Strict”Can set mode=“Legacy” or “Strict”Recommend updating pages to be XHTML Recommend updating pages to be XHTML compliant long-termcompliant long-term
ASP.NET 1.X to ASP.NET 2.0ASP.NET 1.X to ASP.NET 2.0
Other XHTML issues:Other XHTML issues:New pages include a DOCTYPE directive New pages include a DOCTYPE directive indicating XHTML 1.0 Transitional indicating XHTML 1.0 Transitional compliancecompliance
Can cause rendering problemsCan cause rendering problems
Update your HTML to be XHTML compliantUpdate your HTML to be XHTML compliant
ASP.NET 1.X to ASP.NET 2.0ASP.NET 1.X to ASP.NET 2.0
Well known client-side script files are Well known client-side script files are now encapsulated as resourcesnow encapsulated as resources
.js files are now referenced: .js files are now referenced: WebResource.axd?WebResource.axd?a=s&r=WebUIValidation.jsa=s&r=WebUIValidation.js
Hand-editing WebUIValidation.js file will Hand-editing WebUIValidation.js file will no longer workno longer work
Use expanded client-side scripting Use expanded client-side scripting support insteadsupport instead
ASP.NET 1.X to ASP.NET 2.0ASP.NET 1.X to ASP.NET 2.0
Potential for naming collisionsPotential for naming collisions2,000+ new classes in V2.02,000+ new classes in V2.0
Common name collisions: Membership, Roles, Common name collisions: Membership, Roles, ThemeTheme
Does not affect compiled binariesDoes not affect compiled binariesCLR automatically picks the correct type CLR automatically picks the correct type
Collisions will affect you only if you re-compileCollisions will affect you only if you re-compile
ASP.NET 1.X to ASP.NET 2.0ASP.NET 1.X to ASP.NET 2.0
Identify collision candidates todayIdentify collision candidates todayCan use fully qualified class namesCan use fully qualified class names
(e.g., MyProject.Membership instead of (e.g., MyProject.Membership instead of Membership)Membership)
Or use an alternative class nameOr use an alternative class name
Visual Studio 2003 to Visual Studio 2003 to Visual Studio 2005 (RTM)Visual Studio 2005 (RTM)
Visual Studio ConversionVisual Studio Conversion
Visual Studio 2005 makes Visual Studio 2005 makes significant changes to web significant changes to web projectsprojects
Provides much more flexibility for web scenariosProvides much more flexibility for web scenarios
Key BenefitsKey BenefitsNo more project file requiredNo more project file required
Web projects no longer compiled into single DLLWeb projects no longer compiled into single DLL
Can update pages/code while using the debuggerCan update pages/code while using the debugger
No need to re-compile when making changesNo need to re-compile when making changes
Significantly cleaner code-behind modelSignificantly cleaner code-behind model
Web projects can be written in multiple Web projects can be written in multiple languageslanguages
Visual Studio ConversionVisual Studio Conversion
Visual Studio 2005 converts existing Visual Studio 2005 converts existing Visual Studio 2003 projects on openVisual Studio 2003 projects on open
One way conversion (cannot open in One way conversion (cannot open in Visual Studio 2003 afterwards)Visual Studio 2003 afterwards)
Always enable backup option as part of Always enable backup option as part of upgrade wizardupgrade wizard
All conversion changes are loggedAll conversion changes are logged
Visual Studio ConversionVisual Studio Conversion
When running under source control:When running under source control:Move project to new location on disk Move project to new location on disk
Open project and run the conversion Open project and run the conversion wizardwizard
Check back into source controlCheck back into source control
Visual Studio 2005 ConversionVisual Studio 2005 Conversion
New Code-Behind ModelNew Code-Behind ModelVisual Studio no longer Visual Studio no longer generates/modifies code in your code-generates/modifies code in your code-behindbehind
Control definitions use new Control definitions use new partialpartial classclass feature of V2 compilersfeature of V2 compilers
Still enables definition of custom base Still enables definition of custom base pages + control classespages + control classes
Visual Studio 2005 ConversionVisual Studio 2005 Conversion
ASP.NET 1.1 code-behind class definition ASP.NET 1.1 code-behind class definition public classpublic class WebForm1 : System.Web.UI.Page WebForm1 : System.Web.UI.Page
ASP.NET 2.0 code-behind class definition ASP.NET 2.0 code-behind class definition publicpublic partialpartial classclass WebForm1 : WebForm1 : System.Web.UI.PageSystem.Web.UI.Page
Issue Tracker – After Running Issue Tracker – After Running the Conversion Wizardthe Conversion Wizard
Visual Studio 2005 ConversionVisual Studio 2005 Conversion
New dynamic compilation model:New dynamic compilation model:Monolithic code-behind assembly is no Monolithic code-behind assembly is no longer usedlonger used
Pages are compiled on-demand into separate Pages are compiled on-demand into separate assemblies assemblies
Lead to some problems in Beta 2 and Lead to some problems in Beta 2 and earlierearlier
Based on customer feedback – more Based on customer feedback – more “smarts” built into conversion wizard“smarts” built into conversion wizard
Smoother migration for RTM!Smoother migration for RTM!
Visual Studio 2005 ConversionVisual Studio 2005 Conversion
Post-Beta 2 changes to conversion Post-Beta 2 changes to conversion wizardwizard
Moves non-page type definitions out of Moves non-page type definitions out of code-behind and into App_Codecode-behind and into App_Code
Cross-file class references continue to Cross-file class references continue to workwork