Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation."— Presentation transcript:

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

2

3 Agenda Migrating from Microsoft ASP.NET 1.X to ASP.NET 2.0 Microsoft Visual Studio 2003 to Visual Studio 2005 (RTM)

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

5 ASP.NET 1.X to ASP.NET 2.0 Goal: Easy to upgrade from V1.1 to V2.0 We have minimized breaking changes New migration functionality added post- Beta2 No OS upgrade required Runs on Microsoft Windows 2000 & IIS 5.0 Runs on Microsoft Windows XP & IIS 5.1 Runs on Microsoft Windows Server 2003 & IIS 6.0

6 ASP.NET 1.X to ASP.NET 2.0 Beta 2 ASP.NET 1.1 & 2.0 can be installed on same machine Installing V2.0 on V1.1 server Always preserves existing V1.1 mappings New MMC tab to easily switch versions Existing ASP.NET 1.1 applications can run on top of ASP.NET 2.0

7 Issue Tracker – V1.1 Issue Tracker – V1.1 version running on top of ASP.NET 2.0 post-Beta 2

8 ASP.NET 1.X to ASP.NET 2.0 Beta 2 Forms Authentication Works across both ASP.NET versions ASP.NET 2.0 uses AES encryption by default Tweak to change this

9 Sharing Forms Authentication Tickets

10 ASP.NET 1.X to ASP.NET 2.0 New ASP.NET reserved directory names (App_) New naming convention for protecting directories Avoid naming directories with this prefix ASP.NET Reserved directories /Bin – Reserved for assemblies. Same as 1.0 & 1.1 /App_Code – Reserved for code /App_Data – Reserved for data (*.mdf,.xml, etc.) /App_Themes – Reserved for theme files (.skin) /App_WebReferences – Reserved for.wsdl files /App_LocalResources – Reserved for local page resources /App_GlobalResources – global resources

11 ASP.NET 1.X to ASP.NET 2.0 XHTML compliance XHTML compliant markup is now emitted by default Good for standards compliance, but can break some UI Defaults to mode=“Transitional” Can set mode=“Legacy” or “Strict” Recommend updating pages to be XHTML compliant long-term

12 ASP.NET 1.X to ASP.NET 2.0 Other XHTML issues: New pages include a DOCTYPE directive indicating XHTML 1.0 Transitional compliance Can cause rendering problems Update your HTML to be XHTML compliant

13 ASP.NET 1.X to ASP.NET 2.0 Well known client-side script files are now encapsulated as resources.js files are now referenced: WebResource.axd?a=s&r=WebUIValidation.js Hand-editing WebUIValidation.js file will no longer work Use expanded client-side scripting support instead

14 ASP.NET 1.X to ASP.NET 2.0 Potential for naming collisions 2,000+ new classes in V2.0 Common name collisions: Membership, Roles, Theme Does not affect compiled binaries CLR automatically picks the correct type Collisions will affect you only if you re-compile

15 ASP.NET 1.X to ASP.NET 2.0 Identify collision candidates today Can use fully qualified class names (e.g., MyProject.Membership instead of Membership) Or use an alternative class name

16 Visual Studio 2003 to Visual Studio 2005 (RTM)

17 Visual Studio Conversion Visual Studio 2005 makes significant changes to web projects Provides much more flexibility for web scenarios Key Benefits No more project file required Web projects no longer compiled into single DLL Can update pages/code while using the debugger No need to re-compile when making changes Significantly cleaner code-behind model Web projects can be written in multiple languages

18 Visual Studio Conversion Visual Studio 2005 converts existing Visual Studio 2003 projects on open One way conversion (cannot open in Visual Studio 2003 afterwards) Always enable backup option as part of upgrade wizard All conversion changes are logged

19 Visual Studio Conversion When running under source control: Move project to new location on disk Open project and run the conversion wizard Check back into source control

20 Issue Tracker – File Structure after Conversion

21 Visual Studio 2005 Conversion New Code-Behind Model Visual Studio no longer generates/modifies code in your code- behind Control definitions use new partial class feature of V2 compilers Still enables definition of custom base pages + control classes

22 Visual Studio 2005 Conversion Syntax differences: ASP.NET 1.1 page definition ASP.NET 1.1 code-behind class definition public class WebForm1 : System.Web.UI.Page ASP.NET 2.0 page definition ASP.NET 2.0 code-behind class definition public partial class WebForm1 : System.Web.UI.Page

23 Issue Tracker – After Running the Conversion Wizard

24 Visual Studio 2005 Conversion New dynamic compilation model: Monolithic code-behind assembly is no longer used Pages are compiled on-demand into separate assemblies Lead to some problems in Beta 2 and earlier Based on customer feedback – more “smarts” built into conversion wizard Smoother migration for RTM!

25 Visual Studio 2005 Conversion Post-Beta 2 changes to conversion wizard Moves non-page type definitions out of code-behind and into App_Code Cross-file class references continue to work MyControl ctl = (MyControl) Page.LoadControl(“ctl.ascx”); Calls to Type.GetType are adjusted

26 Cross File Class References

27 Visual Studio 2005 Conversion ASP.NET 2.0 introduce pre-compilation Compiles source code into assemblies Deploy only pages and assemblies No source ends up on the server Similar function to compilation from 1.1 Works with new dynamic compilation model

28 Visual Studio 2005 Conversion Can pre-compile with: aspnet_compiler.exe command line tool “Publish Website” menu option within Visual Studio 2005 Two choices when pre-compiling: All.aspx markup is removed All.aspx markup preserved

29 Application Pre-Compilation

30 Session Summary ASP.NET V1.1 and V2.0 run side-by- side on same server No need to migrate apps in order to start using V2.0 New conversion wizard in RTM makes migration even easier Things to-do today: Start making HTML markup XHTML compliant Avoid class naming conflicts with new V2.0 features now where possible

31 Compatibility DevLabs! Also in Redmond, WA June 27-30 th July 25 th -28 th No Cost to Attend (you cover your T&E) Drop by Web Cabana afterwards for more info

32 Your Feedback is Important! Please Fill Out a Survey for This Session on CommNet

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


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

Similar presentations


Ads by Google