web320 migrating asp.net 1.x applications to asp.net 2.0 stefan schackow program manager web...

33
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

Upload: winfred-dixon

Post on 13-Jan-2016

224 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 2: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation
Page 3: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft 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)

Page 4: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Migrating from ASP.NET 1.X to Migrating from ASP.NET 1.X to ASP.NET 2.0ASP.NET 2.0

Page 5: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 6: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 7: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 8: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 9: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Sharing Forms Sharing Forms Authentication TicketsAuthentication Tickets

Page 10: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 11: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 12: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 13: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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&amp;r=WebUIValidation.jsa=s&amp;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

Page 14: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 15: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 16: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Visual Studio 2003 to Visual Studio 2003 to Visual Studio 2005 (RTM)Visual Studio 2005 (RTM)

Page 17: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 18: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 19: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 20: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Issue Tracker – File Structure Issue Tracker – File Structure after Conversionafter Conversion

Page 21: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

Page 22: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Visual Studio 2005 ConversionVisual Studio 2005 Conversion

Syntax differences:Syntax differences:ASP.NET 1.1 page definitionASP.NET 1.1 page definition

<%@ page <%@ page codeBehindcodeBehind=“webform1.aspx.cs” =“webform1.aspx.cs” inheritsinherits=“WebForm1” %>=“WebForm1” %>

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 page definitionASP.NET 2.0 page definition<%@ page <%@ page codeFilecodeFile=“webform1.aspx.cs” =“webform1.aspx.cs” inheritsinherits=“WebForm1” %>=“WebForm1” %>

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

Page 23: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Issue Tracker – After Running Issue Tracker – After Running the Conversion Wizardthe Conversion Wizard

Page 24: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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!

Page 25: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

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

MyControl ctl = (MyControl) MyControl ctl = (MyControl) Page.LoadControl(“ctl.ascx”);Page.LoadControl(“ctl.ascx”);

Calls to Type.GetType are adjustedCalls to Type.GetType are adjusted

Page 26: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Cross File Class ReferencesCross File Class References

Page 27: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Visual Studio 2005 ConversionVisual Studio 2005 Conversion

ASP.NET 2.0 introduce pre-compilationASP.NET 2.0 introduce pre-compilationCompiles source code into assembliesCompiles source code into assemblies

Deploy only pages and assembliesDeploy only pages and assemblies

No source ends up on the serverNo source ends up on the server

Similar function to compilation from 1.1Similar function to compilation from 1.1

Works with new dynamic compilation Works with new dynamic compilation modelmodel

Page 28: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Visual Studio 2005 ConversionVisual Studio 2005 Conversion

Can pre-compile with:Can pre-compile with:aspnet_compiler.exe command line toolaspnet_compiler.exe command line tool

““Publish Website” menu option within Publish Website” menu option within Visual Studio 2005Visual Studio 2005

Two choices when pre-compiling:Two choices when pre-compiling:All .aspx markup is removedAll .aspx markup is removed

All .aspx markup preservedAll .aspx markup preserved

Page 29: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Application Pre-CompilationApplication Pre-Compilation

Page 30: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Session SummarySession Summary

ASP.NET V1.1 and V2.0 run side-by-ASP.NET V1.1 and V2.0 run side-by-side on same serverside on same server

No need to migrate apps in order to start No need to migrate apps in order to start using V2.0using V2.0

New conversion wizard in RTM makes New conversion wizard in RTM makes migration even easiermigration even easier

Things to-do today:Things to-do today:Start making HTML markup XHTML compliantStart making HTML markup XHTML compliant

Avoid class naming conflicts with new V2.0 Avoid class naming conflicts with new V2.0 features now where possiblefeatures now where possible

Page 31: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Compatibility DevLabs!Compatibility DevLabs!

Also in Redmond, WAAlso in Redmond, WAJune 27-30June 27-30thth

July 25July 25thth-28-28thth

No Cost to Attend (you cover your T&E)No Cost to Attend (you cover your T&E)

Drop by Web Cabana afterwards for more Drop by Web Cabana afterwards for more infoinfo

Page 32: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

Your FeedbackYour Feedbackis Important!is Important!

Please Fill Out a Survey forPlease Fill Out a Survey forThis Session on CommNetThis Session on CommNet

Page 33: WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation

© 2004 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.