Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation

Slides:



Advertisements
Similar presentations
Malek Kemmou Technology Architect, Application Platform Microsoft Middle East and Africa Overview of ASP.NET 2.0.
Advertisements

DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Anatomy of an ASP.NET Page. Slide 2 My Version of the Big Picture (1) ASP Worker (Engine) Your application Runs Server Other applications User 1User 2.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Web Platform Introduction With a focus on “free” Mike Taulty Developer & Platform Group Microsoft Ltd
IIS v7.0 Martin Parry Developer & Platform Group Microsoft Limited
Membership, Role Manager and Profile Membership, Role Manager and Profile Matt Gibbs ASP.NET Development Manager.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
IIS 7: The Next Generation Web Application Server Platform Michael Volodarsky Program Manager Web Platform and Tools Team Microsoft Corporation.
 Visual Studio has great support for building ASP.NET web applications  Real web application development involves more than just copying the files created.
April-June 2006 Windows Hosting Seminar Series Product Roadmap: IIS 7.0 Matthew Boettcher Web Platform Technical Evangelist (Hosting) Developer & Platform.
Enterprise Reporting with Reporting Services SQL Server 2005 Donald Farmer Group Program Manager Microsoft Corporation.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
WEB329 ASP.NET: A Lap Around the New Enhancements for Web Developers in Microsoft Visual Studio 2005 Omar Khan Lead Program Manager Web Platform and Tools.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Preview of ASP.NET 2.0 in Delphi Course #3182 Jim Tierney Principal Engineer - Borland.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Deployment of web Site. Preparing the web site for deployment you now have two versions of web site 1 -one running in the production environment 2-one.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 5: Managing File Access.
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Building multi-lingual ASP.Net application that handle western languages and Arabic with a single code base.
Efficient Deployment & Management of ASP.NET 2.0 Applications on IIS 6.0 Alexis Eller Program Manager Internet Information Services Microsoft Corporation.
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Reset and Recycle IIS Reset Application Pool Management Error Codes New HTTP Sub-status codes Custom/Detailed Errors Tracing in IIS7 and.
From DNA to.NET Design Path. Objectives Sketch up a typical Win DNA Application Sketch up the.NET version Compare Design and Implementation Advantages.
Microsoft Dynamics NAV 2009 and Architecture Overview Name Title Microsoft Corporation.
Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically generated web pages.
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation.
Ins and Outs of Authenticating Users Requests to IIS 6.0 and ASP.NET Chris Adams Program Manager IIS Product Unit Microsoft Corporation.
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
This is the main tracing and diagnostics presentation. Very important that this be practical and useful information. IT Pro audience is very.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
DEV395 No Touch Deployment for Windows Forms Jamie Cool Program Manager.NET Client Microsoft Corporation.
Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation
WEB322 ASP.NET Internals: Under the Covers – Exploring Internals, Page Lifecycle and the Compilation Model Simon Calvert Program Manager Web Platform and.
Migrating ASP to ASP.NET Matt Gibbs ASP.NET Development Manager.
Configuring and Deploying Web Applications Lesson 7.
A Lap Around New Enhancements for Web Developers in Visual Studio 2005 Alexander Holy Developer Evangelist, Microsoft EMEA
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
Alexey Polovinkin Post graduate student, CMC department.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Developing Custom ASP.NET Providers For Membership And Role Manager Stefan Schackow PRS404 Program Manager – Web Platform and Tools Microsoft Corporation.
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
//liveVirtualacademy2011/ What’s New for ASP.NET 4.5 and Web Development in Visual Studio 11 Developer Preview Γιώργος Καπνιάς MVP, MCT, MCDP, MCDBA, MCTS,
Building More Powerful ASP.NET Applications with IIS7 Michael Volodarsky COM303 Program Manager Microsoft Corporation.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
ASP.NET Overview Brian Hitney Developer Evangelist Microsoft Corporation
Vinod Unny Enterprise InfoTech Microsoft Regional Director, North India
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
ClickOnce Deployment (One-click Deployment)
Introduction ITEC 420.
Netscape Application Server
Introduction to ASP.NET 2.0
Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek
IIS v7.0 Martin Parry Developer & Platform Group Microsoft Limited
ASP.NET 2.0 Overview Created By: Ajay Bahoriya.
ClickOnce Deployment (One-click Deployment)
Introduction to ASP.NET Parts 1 & 2
Mark Quirk Head of Technology Developer & Platform Group
Visual Studio 2005 IDE Features
Presentation transcript:

Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation

Agenda Migrating from ASP.NET 1.X to ASP.NET 2.0 Visual Studio 2003 to Visual Studio 2005 Conversion

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

ASP.NET 1.X to ASP.NET 2.0 Goal: Easy to upgrade from V1.1 to V2.0 –We have minimized breaking changes –No OS upgrade required Runs on Windows 2000 & IIS 5.0 Runs on Windows XP & IIS 5.1 Runs on Windows Server 2003 & IIS 6.0 Please Let us know if you find issues with Beta2

ASP.NET 1.X to ASP.NET 2.0 ASP.NET 1.1 & 2.0 can be installed on same machine –Application versions run side-by-side under IIS –Version used identified by IIS vroot ISAPI script-mappings Installing v2.0 on v1.1 server preserves existing v1.1 application mappings –V1.1 applications do not automatically get updated to use V2.0 –Administrator must manually update application using IIS Admin Tool Existing ASP.NET v1.1 applications should run fine using ASP.NET v2.0 –But always test application prior to deployment to verify

Issue Tracker – V1.1 Issue Tracker – V1.1 version running on top of ASP.NET 2.0

ASP.NET 1.X to ASP.NET 2.0 It is possible to upgrade parts of a site to ASP.NET V2.0 while leaving the rest of it to run under ASP.NET V1.1 – on V2.0 and on V1.1http://foo.mysite.comhttp:// – on V2.0 and on V1.1http:// Forms Authentication can work across both ASP.NET versions –To enable in ASP.NET 2.0 you must explicitly set decryption attribute in the machineKey section to 3DES ASP.NET 2.0 encryption default of AES is not compatible with 1.1 Tickets issued in 1.1 are then consumable by ASP.NET 2.0 Tickets issued by ASP.NET 2.0 are then consumable by 1.1 app

Sharing forms authentication tickets

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 and 1.1 –/App_Code – Reserved for code –/App_Data – Reserved for data storage (*.mdf,.xml, etc.) –/App_Themes – Reserved for theme files (.skin) –/App_WebServices – Reserved for.wsdl files –/App_Resouces – Reserved for local page resource files –/App_GlobalResources – Reserved for global resource files

ASP.NET 1.X to ASP.NET 2.0 XHTML compliance switch –XHTML compliant markup is now emitted by default –Good for standards compliance, but can break some UI –Web.config file setting to use older HTML markup rendering –Set this to help with migration of existing sites –Recommend updating pages to be XHTML compliant long-term

ASP.NET 1.X to ASP.NET 2.0 Other XHTML issues: –New pages created using VS2005 include a DOCTYPE directive indicating XHTML 1.1 compliance –IE will render page in browser differently if DOCTYPE present Remove the DOCTYPE to get older html rendering behavior –In future you should update your HTML to be XHTML compliant

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 like: WebResource.axd?a=s&r=WebUIValidation.js –Hand-editing WebUIValidation.js file will no longer work –Use the expanded client-side scripting support in ASP.NET 2.0 for enabling common client-scripting scenarios instead

ASP.NET 1.X to ASP.NET 2.0 Potential for naming collisions with existing source code –2,000+ new classes in V2.0 –Common name collisions: Membership, Roles, Profile, Theme Name collisions do not affect already compiled binaries –CLR automatically picks the correct type to use in this case –Name collisions will affect you if you re-compile your project source Recommend you identify collision candidates today –Use a fully qualified class name when referencing these types (e.g. MyProject.Membership instead of Membership) –Alternatively use an alternative class name to avoid future issues

Visual Studio 2003 to Visual Studio 2005 Conversion

Visual Studio Conversion VS 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 –Web projects can now be written in multiple languages –No need to re-compile project when making changes –Ability to update pages/code while using the debugger –Significantly cleaner and more robust code-behind model

Visual Studio Conversion VS 2005 converts existing VS 2003 projects on open –One way conversion (cannot open in VS 2003 afterwards) –Always enable backup option as part of upgrade wizard –ConversionReport.txt lists all changes as part of the upgrade Things to be aware of during conversion: –New directories may be created (App_Code, App_WebReferences) –Non-page related class files (.cs,.vb) will be moved to App_Code dir –“Designer generated” sections are processed by the conversion tool –Pages automatically updated to use new code-behind model Recommendations when running under source control: –Move project to new location on disk (out of source control) –Open project and run the conversion wizard –Check back into source control

Visual Studio Conversion New Code-Behind Model –Removes need for VS to generate/modify code in your code-behind –Control definition now handled using new partial class feature of V2 compilers –Still enables definition of custom base pages + control classes 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

ASP.NET 2.0 Code-behind Default.aspx Page codefile=“default.aspx.cs” inherits=“Default” public partial class Default : System.Web.UI.Page Default.aspx.cs File containing code behind class definition File containing code behind class definition Class that the page-gen inherits from Class is ‘partial’ and is combined to an auto-generated partial class Base class. Can be defined by user. The required ancestor base class is System.Web.UI.Page Dynamic Compile Auto- generated page class MyClass Auto- generated partial Default Partial class defined in codefile DefaultSystem.Web.UI.Page

Issue Tracker – After running the conversion wizard

Visual Studio Conversion New dynamic compilation model implications: –Monolithic code-behind assembly is no longer used Instead, pages are compiled on-demand into separate assemblies –Code-behind code that references classes defined within other code-behind files will fail Move these classes out of code-behind files into standalone.cs and.vb files (can use App_Code directory or separate assembly) –Best practice to prepare for this with ASP.NET 1.1: Move classes, enumerations and interfaces that are not related to a page into standalone.vb or.cs files now In addition to making migration easier it is a better coding practice

Cross file class references

Visual Studio Conversion New dynamic compilation model implications: –Type casting dynamically loaded user controls requires an explicit reference to the.ascx files In 1.1, since all code lived in the same assembly, user control type names were always available for type casting –In 2.0, add page directive MyControl ctl = (MyControl) Page.LoadControl(“ctl.ascx”); Note: This is not needed if you don’t explicitly cast control

Visual Studio Conversion New dynamic compilation model implications: –Code that calls Type.GetType(“SomeType”) will fail if referencing classes in other code-behind files or in files deployed in App_Code –Instead, use: System.Web.Compilation.BuildManager.GetType The ASP.NET BuildManager has extra logic to “look” at all ASP.NET related assemblies VS 2005 project migration wizard will update code that does this

Type Resolution

Visual Studio Conversion Developers can pre-compile an ASP.NET site with: –aspnet_compiler.exe command line tool –“Publish Website” menu option within VS 2005 Two choices when pre-compiling: –All code compiled and.aspx markup removed –All code compiled, but.aspx preserved for later html edits (note: this is new in Beta2 and now the default)

Application Pre-compilation

Session Summary ASP.NET V1.1 and V2.0 run side-by-side on same server –No need to migrate all apps in order to start using V2.0 Backwards compatibility a priority with new APIs and features –Please tell us in Beta2 when you find things that break VS 2005 auto upgrades existing web projects to use new project model –Provides significantly better flexibility for web projects –Need to be aware of a few implications of dynamic compilation model Things to-do today to prepare for ASP.NET V2.0: –Start making HTML markup XHTML compliant –Separate non-codebehind classes/enums into separate class files –Avoid class naming conflicts with new V2.0 features now where possible

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

APPENDIX

Demonstration Four Issue Tracker – Converting pages to use as a master page

Designing for ASP.NET 2.0 Rich data-binding to middle tier objects is now possible –Many Web applications require the use of clearly defined middle tiers –Traditionally has been awkward to use with data-binding ObjectDataSource supports two-way data binding to objects –Allows developers to write changes back to the database –Two-way functionality only supported on new ASP.NET 2.0 data controls

Designing for ASP.NET 2.0 Middle tier object design guidelines –Objects should be stateless Example: Need to be able to call select method one page hit, but process an update on postback. –Need a default parameter-less constructor –Expose methods for select, insert, update and delete functionality (static methods are preferred but not required) –Methods should accept zero or more parameters to carry out the appropriate operation

Designing for ASP.NET 2.0 Middle tier object design guidelines –Objects that use the following pattern will not be able to update/insert data via ObjectDataSource: MyType myObject = new MyType(); myObject.PropertyA = “foo”; myObject.PropertyB = “bar”; myObject.Update(); –Instead use: MyType myObject = new MyType(); myObject.PropertyA = “foo”; myObject.PropertyB = “bar”; MyType.Update(myObject);

ASP.NET 2.0 Runtime Designing for ASP.NET 2.0 should include designing for runtime improvements Design with caching in mind –New cache features covered in earlier presentations –Design “Everett” applications to take advantage of ASP.NET 2.0 cache improvements –User Control encapsulation will help! –Web sites with clean middle tiers can easily use Sql cache dependencies –Datasource controls have built-in support for Sql cache dependencies

ASP.NET 2.0 Runtime OLEDB is now supported in partial trust –1.1 applications using Microsoft ® Access always needed full trust –ADO.NET team enabled partially trusted callers in ASP.NET 2.0 –Hosters can now use for customers using Access

ASP.NET 2.0 Runtime Forms authentication support on querystrings –Forms auth ticket can be encrypted and automatically placed on the querystring –Enables forms auth for both desktop and mobile browsers –With extra coding, also enables passing authentication information across Web sites Enables a custom pseudo-”SSO” Remember that key material still needs to be synchronized

ASP.NET 2.0 Runtime Richer event model in Http pipeline –Most events now have a “PostXYZ” event PostAuthenticateRequest PostAuthorizeRequest Etc. –Allows more granular Http module authoring –Eliminates request ordering issues where certain modules must logically run before an event Example: PostAuthenticateRequest can be used for authorization logic prior to AuthorizeRequest

ASP.NET 2.0 Runtime Richer event model in Http pipeline –Do choose the appropriate event for the work your module performs –Don’t use Http modules as a “pseudo-handler” Use.ashx files or custom handlers –If your module sends response headers Hook both EndRequest and PreSendRequestHeaders Send response headers in the first event that is called. Ignore the second event firing.

ASP.NET 2.0 Runtime Synchronous page execution –Traditionally - work performed on pages runs synchronously –Ties up an ASP.NET worker thread for the duration of the request –1.1 pages are synchronous –performing async calls in page code did not help –Somewhat convoluted design pattern was necessary to truly handle async work in “Everett” pages

ASP.NET 2.0 Runtime ASP.NET 2.0 Asynchronous Pages –New page directive “Async” –Two event delegates need to be implemented in page code –Async processing occurs just before PreRender event Design Guideline –Isolate long-running tasks in their own object –Design pages to defer long-running tasks to the async event delegates

Demonstration Five Issue Tracker – Converting project list to an async page

ASP.NET 2.0 Runtime Request prioritization –New “requestPriority” attribute on –Can set per vdir using tags –Can group sets of pages into directories according to desired priority “Critical” pages will always be queued for execution –“High” priority pages execute before “Normal” priority pages –“Normal” is the default priority

ASP.NET 2.0 Runtime Buffered Uploads –Handles large file uploads –Large SOAP headers when calling.asmx pages –Large Http requests New attribute “requestLengthDiskThreshold” on –If request length exceeds limit (256Kb default), content is spooled to disk –Minimizes memory overhead for concurrent large requests

ASP.NET 2.0 Runtime Protected Configuration –Allows any configuration section in ASP.NET 2.0 to be encrypted –Built-in support for RSA and DPAPI Extensible support allows custom encryption with custom providers –A custom protected configuration provider does not necessarily need to “encrypt” anything Could instead load configuration information from an off-the-box location

ASP.NET 2.0 Runtime IIS6: requests can run through ASP.NET and “fall back out” to IIS –Enables ASP.NET authN/authZ for non-ASP.NET file extensions –Instead of the page handler running, the request is passed to DefaultHttpHandler Request is handed off to the ISAPI extension associated with the file type IIS5: ASP.NET has an optimized StaticFileHandler (.jpg,.htm, etc.) –Dynamic content (i.e..asp) not supported though

ASP.NET 2.0 Runtime Health Monitoring –Built-in support for logging various event information and errors to providers –Can store event information in different data stores with custom providers –ASP.NET 2.0 automatically logs errors to the event log Comprehensive information for tracking down problems on production servers where debug access is usually not available Look at Health Monitoring before writing a custom event infrastructure

Demonstration Six Health Monitoring – Event Log Entries

Providers Uses new Provider Design pattern –Pluggable Data Access Layer (DAL) –Pluggable Business Logic Layer (BLL) We are shipping Providers for various data stores: –SQL Server –AD/ADAM Provider model is extensible –Create and integrate new providers

New ASP.NET ASP.NET 2.0 “Building Block” APIs Role Manager Site Navigation Management Provider Model Design Pattern Providers Windows SQL Server AD/ADAM Database Caching ASP.NET 2.0 Developer Stack Membership Profile and Personalization

New ASP.NET ASP.NET 2.0 “Building Block” APIs Role Manager Site Navigation Management Provider Model Design Pattern Providers Windows SQL Server AD/ADAM Database Caching Custom public class OracleMembershipProvider : MembershipProvider {} public class As400MembershipProvider : MembershipProvider {} ASP.NET 2.0 Developer Stack Membership Profile and Personalization

Providers Can design for these APIs today –Follow method and property conventions depending on which feature you plan to use –Add your own custom behaviors Browse the provider specification on MSDN ® as well as ASP.NET 2.0 help files –Plan to implement classes as a provider –Easier to move a provider to ASP.NET 2.0 –Carry forward today’s investment

Demonstration Seven Issue Tracker – Custom Membership provider for handling login