Paul Yuknewicz Lead Program Manager Microsoft Visual Basic DEV 318
Upgrade Proposition Support Lifecycle Strategies Decision Framework Walkthrough Demos
Upgrade Proposition
Visual Basic is used by more than half of the world’s professional developers 61% of Professional developers 34% use VB.NET The base is growing 42% plan to increase their use over the next year
More Opportunities Faster Performance Less Code Enhanced deployment More secure apps Better job opportunities Platform Support Leverage investments Target Windows, Web, Office and Mobile development with the same set of skills Comparison tests show that applications can have 300% more throughput and be 200% more scalable The My namespace, IntelliSense code snippets, and advances in the.NET Framework reduces the amount of code that developers need to write by 50% or more in many common scenarios Avoid DLL Hell with the.NET Framework ClickOnce provides automatic deployment and versioning of applications Applications built on the.NET Framework take advantage of code access security. VB 2005 developers can take advantage of VB-specific features including a Permission Calculator and Intellisense in Zone. Research on monster.com and dice.com shows 2043 VB.NET jobs but only 795 VB6 jobs VB2005 positions developers to take advantage of coming platform advances in Windows Vista and beyond
Making the case for Upgrade Reuse SkillsReuse CodeGradual & Incremental Upgrade
The My Namespace AutoCorrect Edit and Continue Optional Parameters Dynamic Language Background Compilation Just My Code Case Insensitivity …
Visual Basic 6.0 Runtime Ships with Vista VB 6.0 applications have mainstream support until 2012 Intent is for similar Longhorn support With extended support, VB 6.0 apps can be supported until 2017 Visual Basic 6.0 IDE Supported until APR-2008 Custom Support available after APR-2008 Runs on Vista VB6.0 IDE also runs on XP VB 6.0 IDE Extended support e nds 08-APR-2008 Vista, VB6 runtime Mainstream support ends 10-APR-2012 Vista, VB6 runtime Extended support ends 11-APR-2017 Windows XP Mainstream support e nds 31-JAN-2008 Windows XP Extended support ends 31-JAN-2014 ends Windows XP Extended support ends 31-JAN-2014 ends
Application or tier currently serves important business need Upgrade metrics: Increased productivity Reduced code, costs, risks, support Flexibility & scalability with increasing business demands Tools consolidation
Planning should always happen before upgrade Perform Upgrade/Stabilize/Test iteratively New value accrues at the enhancement phase Planning & Assessment UpgradeStabilizeTestEnhance
Analyze the Application (use free Assessment Tool!) Architecture Dependencies Call Stack Data access Source code metrics (quality, size) Time and cost estimates Analyze the Target Application Use of COM Interop.Net Functionality Handling of Unsupported Features Expected Productivity Increase
Rewrite Migrate Replace Reuse Current System Quality Business Function / Value Custom Standard High Low
Client Tier Business Tier Data Tier Horizontal vs. Vertical Migration Vertical Horizontal Com Interop
Upgrade Walkthroughs
Leverage some VB.NET now in VB6 via Interop Benefits to this approach: Reuse your assets Most gradual – “Pay as you go” Least risky Downsides: Requires maintaining multiple code bases Does not eliminate VB6 tool usage Great for: Using.NET framework APIs Calling Web Services and Middle Tier logic Using new SQL or Data features
Port VB6 code assets to VB.NET Benefits to this approach: Most flexible Custom business logic preserved UI appearance preserved Consolidates tools Downsides: Requires many iterations and testing Difficult to migrate UI code Poor quality code is not improved Great for: Custom business logic and middle tier code Vertical migrations with lower dependency counts
Strongly type variables Null Propagation Non zero lower bound arrays Replace values with Enums DAO/RDO Data Bindings
Strongly Typed SolutionSolution LateboundLatebound
LateboundLatebound VB 6 After Upgrade Dim myTextBox myTextBox = "Hey There" Results: Runtime Error Dim myTextBox As Object 'UPGRADE_WARNING: Couldn't resolve default property of object myTextBox. myTextBox = "Hey There"
VB 6 Dim myTextBox As TextBox myTextBox = "Hey There" After Upgrade Dim myTextBox As _ System.Windows.Forms.TextBox myTextBox.Text = "Hey There" Results: Works Perfectly Strongly Typed LateboundLatebound
SolutionsSolutions Solution 1: Prepare in Visual Basic 6.0 Dim myTextBox myTextBox = "Hey There" As TextBox Dim myTextBox As Object 'UPGRADE_WARNING: Couldn't resolve default property of object myTextBox = "Hey There" Solution 2: Fix After Upgrade Strongly Typed LateboundLatebound
Visual Basic 6.0 Code Advisor 1.) not upgraded reliably to Visual Basic.NET 11.) The use of is not valid for the property being assigned 2.) project item type is not supported in Visual Basic.NET and will not be upgraded 12.) There is no Line control in Visual Basic.NET 3.) not upgraded to Visual Basic.NET by the Upgrade Wizard 13.) There is no Shape control in Visual Basic.NET 4.) has no Visual Basic.NET equivalent and will not be upgraded 14.) UpDown controls are not upgraded to Visual Basic.NET by the Upgrade Wizard 5.) As Any is not supported in Visual Basic.NET. Use a specific type 15.) Use Option Explicit to avoid implicitly creating variables of type Variant 6.) Changing ScaleMode at run-time is not supported16.) is not a property of the generic object in Visual Basic.NET. 7.) Replace DAO Data Binding with ADO17.) Whenever possible replace ActiveForm or ActiveControl with an early-bound variable 8.) Replace function with function18.) Declare with an early-bound data type 9.) Return has new meaning in Visual Basic.NET19) Keyword not supported in Visual Basic.Net 10.) The project relies on COM+ transactions that must be upgraded manually 20). Non Zero lowerbound arrays are not supported Issues Identified by the Code Advisor
Form Layout ActiveX Controls ADO Data Binding CodeCode Syntax Changes COM Libraries RES files Issue Warnings
Rewrite code in VB.NET referencing VB6 code Benefits to this approach: Leverages your skills and intellectual property Functionally equivalent Use all VB 2005 productivity features = less code, less bugs Opportunity to share code or expose services Opportunity to improve code quality Opportunity to improve architecture and integration Downsides: Requires many iterations and testing Cost and time Great for: New UI experiences Exposing middle tier to VB6 & VB.NET clients
Visit for best ways to increase your.Net skillshttp://msdn/vbasic/learn/ Leverage My & Snippets to perform tasks in.NET It’s ok to rely on your VB6 knowledge Some additional VB Power Pack controls were created just for you: Printer Compatibility Library PrintForm Line & Shape Controls (CTP) Data Repeater (coming soon) Tell us what you need on Connect!
Now is the best time to think about VB.NET upgrades Upgrade gradually and incrementally New development should use VB.NET Microsoft will continue investing in your success
VB6 Resource Center PAG Migration Guide Book & Assessment Tool us/dnpag2/html/VB6ToVBNetUpgrade.asp Interop Forms Toolkit 2.0 & VB Power Packs “Upgrading VB6 to VB.NET” MS Press Book VB6 Code Advisor Tool VB6 on Vista Support Statement Blog
DEV318 - Strategies for Moving Your Microsoft Visual Basic 6 Investments to.NET 14/08/ :45 AM - 12:00 PM DEV319 - LINQ and XML for the Microsoft Visual Basic Developer 14/08/2007 2:20 PM - 3:35 PM DEV317 - Microsoft Visual Basic: Tips and Tricks for the Microsoft Visual Studio 2008 IDE 15/08/2007 9:00 AM - 10:15 AM
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.