Migrating from the.NET Framework Version 1.1 to 2.0 Ken Casada Developer Evangelist Developer & Platform Evangelism Microsoft Switzerland.

Slides:



Advertisements
Similar presentations
ACT! “Web” Plugins ACC Webinar (Part 1of 2) Brian Mowka and Jamie Aurand December 2010.
Advertisements

© Leaf Solutions, LLC. All Rights Reserved What’s New in Everett Microsoft.Net V1.1.
Chapter 6 Multiform Projects Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Chapter 9 Chapter 9: Managing Groups, Folders, Files, and Object Security.
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…
Advanced Object-Oriented Programming Features
C# Programming: From Problem Analysis to Program Design1 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 7 Configuring File Services in Windows Server 2008.
Creating Multi-lingual Applications and Websites with Microsoft Visual Studio 2005 Achim Ruopp International Program Manager Microsoft Corporation.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Update your servers to service pack 2. Ensure that the environment is fully functioning. Migrate to 64 bit servers is necessary. REVIEW UPGRADE BEST PRACTICES.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
SharePoint 2010 and Office 2010 Development Randy Williams Senior Consultant & Trainer Synergy Corporate Technologies.
Introduction to.Net and ASP.Net Course Introduction Build Your Own ASP.Net Website: Chapter 1 Microsoft ASP.Net Walkthrough: Creating a Basic Web Forms.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
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.
1 Group Account Administration Introduction to Groups Planning a Group Strategy Creating Groups Understanding Default Groups Groups for Administrators.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Session 1 - Introduction and Data Access Layer
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 5: Managing File Access.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
Microsoft DirectAccess & Work Folders NICHOLAS A. HAY MONROE COUNTY ISD
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
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.
1 © 2004, Cisco Systems, Inc. All rights reserved. CISCO CONFIDENTIAL Using Internet Explorer 7.0 to Access Cisco Unity 5.0(1) Web Interfaces Unity 5.0(1)
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Sage ACT! 2013 SDK Update Brian P. Mowka March 23, 2012 Template date: October 2010.
Upgrading Projects to Visual Studio 2010 Upgrading Projects to SharePoint 2010 Integrating with SharePoint 2010.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Multiform Projects.
Partners’ Webinar 01/31/2013 Karol Jarkovsky Solution Architect Upgrading Kentico.
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.
WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
ISV Community Day Best Practice Per Ahlberg Developer Evangelist Developer & Platform Evangelism Microsoft Sweden.
Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation
CIS 375—Web App Dev II ASP.NET 1 Getting Started.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Open project in Microsoft Visual Studio → build program in “Release” mode.
DEV394.NET Framework: Migrating To Managed Code Adam Nathan QA Lead Richard Lander Program Manager Microsoft Corporation.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
Validation. What is Validation? Removing errors improves the consistency of how our pages look to a wide variety of browsers and devices. Ensuring that.
Internet Explorer 7 Updated Advice for the NHS 04 February 2008 Version 1.3.
CACI Proprietary Information | Date 1 PD² SR13 Client Upgrade Name: Semarria Rosemond Title: Systems Analyst, Lead Date: December 8, 2011.
Troubleshooting Dashhawk Issues. Here's what you have to do to have the DashHawk run properly Go to the ACTUAL PROGRAM file (not the short cut)
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
1 Adding a Model. We have created an MVC web app project Added a controller class. Added a view class. Next we will add some classes for managing movies.
ClickOnce Deployment (One-click Deployment)
Migrating from the .NET Framework Version 1.1 to 2.0
Introduction ITEC 420.
ASP.NET Forms.
Unit Testing.
Unit 7 Learning Objectives
/* LIFE RUNS ON CODE*/ Konstantinos Pantos Microsoft MVP ASP.NET
Web Development in Microsoft Visual Studio 2013
CS 240 – Advanced Programming Concepts
ASP.NET 2.0 Overview Created By: Ajay Bahoriya.
ClickOnce Deployment (One-click Deployment)
MS Confidential : SharePoint 2010 Developer Workshop (Beta1)
Presentation transcript:

Migrating from the.NET Framework Version 1.1 to 2.0 Ken Casada Developer Evangelist Developer & Platform Evangelism Microsoft Switzerland

.NET Framework 3.0 Upgrade Options Breaking changes Windows Client Applications ASP.NET Applications Resources Agenda

Microsoft.NET Framework The Managed Code Programming Model for Windows

.NET Framework 3.0 =.NET Framework bunch of new DLLs If you have already installed.NET 2.0, installing.NET 3.0 will not break existing application Take Away …

Don’t upgrade Should do cost/benefits analysis of upgrading to VS2005 and.NET Framework 2.0 Will features be added? Will app merely undergo bug fixes? Lifespan of application may factor into decision Upgrade Options (1)

Upgrade the Framework to 2.0 (3.0) Allows you to develop new apps in 2.0 Maintain your old apps in 1.x (continue to use VS2003 as development environment) Run apps side by side Run in 2.0 backward compatibility mode (improved security, viewstate performance) Upgrade Options (2)

Which Version Is Used? Application typeComputer with 1.1 Computer with 2.0 Computer with 1.1 and stand-alone application (Web or Microsoft Windows client) Loads with 1.1Loads with 2.0(*)Loads with stand-alone application (Web or Microsoft Windows client) FailsLoads with add-in to a native application (such as Office or Internet Explorer) Loads with 1.1Loads with 2.0(*) Loads with 2.0 unless the process is configured to run against 1.1 (*) 2.0 add-in to a native application (such as Office or Internet Explorer) FailsLoads with 2.0 (*) There are some breaking changes in.NET Framework 2.0

Design-mode breaking changes Do not impact applications compiled with 1.0 or 1.1 running against the.NET Framework 2.0 Changes in behavior (not necessarily breaking) Fewer than 10 actually impact an application Runtime-mode breaking changes API breaking changes (fewer than 5) Method behavior changes Breaking changes

Short Description When very long paths are passed to Server.MapPath, they now fail with an InvalidOperationException instead of a PathTooLongException. Affected APIs System.Web.HttpServerUtility.MapPath SeverityLow Compat Switch Available No Description An application that was passing an invalid long path to MapPath in version 1.1 would get a PathTooLongException bubbled up from the BCL. In version 2.0, there is a native code implementation for WebHost that fails the invalid path. The HostingEnvironment then throws an InvalidOperationException, which results in a 500 User Scenario An application that was passing an invalid long path to MapPath in version 1.1 would get a PathTooLongException bubbled up from the BCL. If the exception was unhandled, the response status code would be 414. In version 2.0, there is a different exception and the status code is 500. Work Around In either release, it's an error condition and any global exception handling mechanisms will be treated identically. Runtime breaking change sample

Protected constructors can no longer be called from their derived types Closes a potential security hole class B { protected B() {} } class D : B { D() : base () {} // this still works static void Main() { new B(); // this breaks! } Design-Time breaking change sample

Which Version Is Used? Application typeComputer with 1.1 Computer with 2.0 Computer with 1.1 and stand-alone application (Web or Microsoft Windows client) Loads with 1.1Loads with 2.0(*)Loads with stand-alone application (Web or Microsoft Windows client) FailsLoads with add-in to a native application (such as Office or Internet Explorer) Loads with 1.1Loads with 2.0(*) Loads with 2.0 unless the process is configured to run against 1.1 (*) 2.0 add-in to a native application (such as Office or Internet Explorer) FailsLoads with 2.0 (*) There are some breaking changes in.NET Framework 2.0

Locate the unmanaged.EXE Create a text file called.exe.config (Ex: myapp.exe  myapp.exe.config) Paste this text into the new text file: <configuration><startup> </startup></configuration> Load Specific Version (EXE)

Installing.NET Framework installs ASP.NET 2.0 By default, this will not change existing IIS Web Sites to 2.0, they will remain to 1.1/1.0 Web site runtime controlled by the new ASP.NET tab in IIS Admin (site properties) Important! DO NOT try to mix ASP.NET 1.1 and 2.0 apps within a single AppPool.  Create separate AppPools for each Version! Load Specific Version (ASP.NET)

Web Application: - side by side deployments backward compatibility mode

Convert your Application to 2.0 Upgrade to VS2005 SP1 ! (VS2005 SP1 Update for Windows Vista available) VS2005 SP1 Update for Windows VistaVS2005 SP1 Update for Windows Vista Develop your application in Microsoft Visual Studio 2005  Use new.NET 2.0 feature ! Upgrade Options (3)

Back up your VS2003/1.1 solution first! Open VS2003 project/solution in VS2005 Open VS2003 project/solution in VS2005 SP1  Conversion wizard convert project/solution to VS 2005 Compile the code Convert your Application to 2.0

Convert Windows Client Applications Trivial in most cases Open the solution in VS2005 Wizard does necessary touchups to project files If it doesn’t work at this point, check the breaking changes list Not a lot of issues out there with this scenario Best way to find out is to just try it Backup your files (don’t forget this, just in case!) See if it works as is

Convert ASP.NET Applications Converting to VS2005 Web Applications (Option#1) Web Application Project template (included in VS2005 SP1) that mirrors the 1.1 file structure and use it Minimal changes to VS2003 code For complex web application, this may be the better choice Recommended choice Converting to VS2005 Websites (Option#2) Referred to as the web site template Web app defined by files in a folder (No project file needed) Dynamic Compilation / Multiple assemblies

If remote project connected via FPSE, move to in VS03 prior to upgrading Open using the solution file in VS03 Do a build solution command to validate all projects in the solution build Run and validate all pages function correctly Step 1: Validate in VS2003 Opt#1

Open SLN file in VS2005  Launches Conversion Wizard Make sure to make a backup Convertion Wizard updates solution file and projects files to VS2005 syntax After conversion build and fixup errors Name collisions with new types in framework  fully qualify names with namespace Warnings about using obsolete members Run application and validate functionality Step 2: Upgrade solution Opt#1

Right click on root node of Web project and select “Convert to Web Application” Converts pages to using partial classes Moves generated designer code into designer.cs (or designer.vb) file Build and fixup errors Likely error, if any, will be because of a missing control declaration that was accidentally removed To fixup declare missing controls in code- behind file (not designer file) Step 3: Convert To Partial Classes Opt#1

Partial Classes Visual Studio 2003 Visual Studio 2005 P2.aspx P2.aspx.cs P1.aspx P1.aspx.cs P2.aspx.designer.cs Opt#1

Visual Studio 2003 Visual Studio 2005 P2.aspx P2.aspx.cs P1.aspx P1.aspx.cs P1.aspx Inherits=“AppName.P1” Codebehind=“P1.aspx.cs” P1.aspx.cs namespace AppName { public class P1 : System.Web.UI.Page { // Contains both user & auto-generated code, e.g. protected System.Web.UI.WebControls.Label Label1; override protected void OnInit(EventArgs e) { … } } P2.aspx.designer.cs Partial Classes Opt#1

P2.aspx Inherits=“P2” CodeBehind=“P2.aspx.cs” P2.aspx.cs namespace AppName { public partial class P2 : System.Web.UI.Page { // Contains user code } P2.aspx.designer.cs namespace AppName { public partial class P2{ protected System.Web.UI.WebControls.Label Label1; override protected void OnInit(EventArgs e)} } Partial Classes Visual Studio 2003 Visual Studio 2005 P2.aspx P2.aspx.cs P1.aspx P1.aspx.cs P2.aspx.designer.cs Opt#1

Right click on root node of Web project and select “Convert to Web Application” Converts pages to using partial classes Moves generated designer code into designer.cs (or designer.vb) file Build and fixup errors Likely error, if any, will be because of a missing control declaration that was accidentally removed To fixup declare missing controls in code- behind file (not designer file) Step 3: Convert To Partial Classes Opt#1

Conversion Wizard sets default validation in tool to Internet Explorer 6 VS2005 provides the ability to validate XHTML compliance errors Change validation in Tools Option to XHTML 1.1 Open individual pages and fixup XHTML issues. If XHTML compliance isn’t desired leave validation to Internet Explore 6 Step 4: Fixup XHTML errors Opt#1

Converting to VS2005 Web Applications Opt#1

Convert ASP.NET Applications Converting to VS2005 Web Applications (Option#1) Web Application Project template (included in VS2005 SP1) that mirrors the 1.1 file structure and use it Minimal changes to VS2003 code For complex web application, this may be the better choice Recommended choice Converting to VS2005 Websites (Option#2) Referred to as the web site template Web app defined by files in a folder (No project file needed) Dynamic Compilation / Multiple assemblies

Open Web Project in VS2003 using solution or project file Do a build solution command to validate all projects in the solution build Run project and test pages to validate all pages run correctly Step 1: Validate in VS2003 Opt#2

Review the web site architecture for possible VS05 conflicts including: Multiple project files referring to same set of files (common files ca be migrated twice)  Duplicate? Evtl. migrate to WAP Other projects referencing the web project  move shared code to a separate class library Excluded Files ignored by the Wizard (project will contain extra unconverted files that are now part of your project) Step 2: Prepare App. in VS2003 Opt#2

Step 3: Upgrade to VS2005 Opt#2 Open using “File > Open Website > Local IIS”  Launches Conversion Wizard Backup your project  Backup Folder outside Web application’s folder tree! If other non-web projects are in VS03 solution: 1. Remove Web Projects from Solution 2. Migration Solution and fixup compile errors 3. Use “Add Existing Website” to add removed Web projects to solution, which will upgrade the web project to a website

Step 4: Post Conversion Fixup Review upgrade report and fixup compile issues reported on build Refactor code for reserved word naming conflicts Clean up: Remove exclude files if needed Remove orphaned resx files Remove member functions like OnInit and InitializeComponent() (if they don’t implement user specific code) Opt#2

Step 4: Post Conversion Fixup …Because of new web site compilation model… Manual fix-up needed: Resource Manager sample CircularReference Code changes done by the conversion Wizard stand-alone class file references Access auto-generated control variable Opt#2

Conversion Wizard sets default validation in tool to Internet Explorer 6 VS2005 provides the ability to validate XHTML compliance errors Change validation in Tools Option to XHTML 1.1 Open individual pages and fixup XHTML issues. If XHTML compliance isn’t desired leave validation to Internet Explore 6 Step 5: Fixup XHTML errors Opt#2

Converting to VS2005 Websites Opt#2

ABC - stand-alone class file ref. FILE ASP.NET 2.0 Code Control1.ascx inherits=”migrated_Control1” Control1.ascx.cs class migrated_Control1 : Control1 { override public void foo() { some code } } App_Code/ Class1.cs String myName = “Class1 + “ + Control1.myName; App_Code/ Control1_stub.cs abstract class Control1 : System.Web.UI.UserControl { public static string myName = “Control1”; abstract public void foo();} FILE ASP.NET 1.x Code Control1.ascxinherits=”Control1” Control1.ascx.cs class Control1 : System.Web.UI.UserControl { public static string myName = “Control1”; public void foo() { some code } } Class1.cs string myName = “Class1 + “ + Control1.myName; Opt#2

Auto-generated control variable FILE ASP.NET 2.0 Code Control1.ascx c1 c1 Control1 hidden partial class //this will be auto-generated in the hidden, partial class protected System.Web.UI.WebControls.Label p_Label1; Control1.ascx.cs public System.Web.UI.WebControls.Label Label1{ get { return p_Label1;} set { p_Label1 = value;} } Page1.aspx.cs Control1 c1=(Control1)LoadControl(“~/Control1.ascx”); C1.Label1.Text = “Foo”; FILE ASP.NET 1.x Code Control1.ascx c1 c1 Control1.ascx.cs public System.Web.UI.WebControls.Label Label1; Page1.aspx.cs Control1 c1=(Control1)LoadControl(“~/Control1.ascx”); C1.Label1.Text = “Foo”; Opt#2

Resource Manager FILE ASP.NET 2.0 Code Control1.ascx.cs String s = Resources.Resource1.foo; App_GlobalResources\Resource1.resx Resource1.resx moved to App_GlobalResource Contains name/value pair “foo = bar” FILE ASP.NET 1.x Code Control1.ascx.cs Assembly a = Assembly.Load(“myApp”); ResourceManager rm = new ResourceManager(“myApp.Resource1”, a); String s = rm.GetString(“foo”); Resource1.resx Contains name/value pair “foo = bar” Opt#2

Q2Q3Q Q2Q4Q1Q3Q4 3.5 RTM Microsoft.NET Framework Ship Schedule 3.0 RTM.NET Framework 3.5: Q SP for.Net Framework 2.0 (bug fixing) 3.5 B1

For More Information Converting to a Web Application Project (WAP) Converting to a Web Site Project (WSP) Common Web Project Conversion Issues and Solutions Step-By-Step Guide to Converting Web Projects from VS03 to VS05 Questions – Forums: Migrating from VS03 to VS05