You are on page 1of 3

Making the Business Case for Upgrading

When you make the decision to upgrade to Visual Studio 2010, your existing applications must be converted to work with Visual Studio 2010 before they can be opened. In most cases, the conversion process doesnt change your code. Instead, it merely updates configuration files, such as project and solution files. The changes that are made depend on whether youre converting

114

Making the Business Case for Upgrading

Windows applications Web applications Class libraries Visual Studio 2010 uses version 4.0 of the .NET Framework by default. The syntax of programming languages, such as C# and Visual Basic, may change with each new version of the .NET Framework as new features are added and existing features are improved. The conversion process doesnt update your code to the latest syntax. Rather, the newer versions of .NET continue to support the syntax of previous versions for example, upgrading versions of .NET doesnt break existing code. Its up to you to figure out whether a new and improved syntax is available and decide whether you want to change your code to use the new syntax. The languages add features in most cases, rather than actually change existing features. In most cases, the changes are slight, rather than major code busting features. When you make the decision to upgrade to Visual Studio 2010, you have lots of choices. In the sections that follow, you find out more specifics about what happens to code when you upgrade, alternatives to upgrading, and what you need to do to upgrade programs in pre-.NET languages.

What happens to Visual Studio code in an upgrade?


As you think about whether you should upgrade, consider these issues: Windows applications and class libraries arent changed much by the conversion process. Even though configuration settings are updated, your code stays the same. Any code or controls that were deprecated in version 4.0 of the .NET Framework still work. You cant use the visual designers for deprecated controls, although you can use the code editor. Your class libraries arent optimized to take advantage of the latest features in .NET 4.0. You have to figure out whether you should change your code. After converting applications to Visual Studio 2010, analyze your code by using FxCop. It offers you suggestions for improving your code. See Book V, Chapter 5 for more information about FxCop. Web applications require some finesse to get all their components converted properly. You need to do some preparation work before you convert them. Applications that are especially complex can be difficult to convert. If you cant convert the entire solution, you may have to convert individual projects one at a time and then add them to your Visual Studio 2010 solution.
Book II Chapter 4

Upgrading .NET

Making the Business Case for Upgrading

115

Clients running your applications must have the .NET 4.0 framework installed. You can convert your applications to work with Visual Studio 2010 and deploy applications to work with previous versions of the .NET Framework. I show you how in the section Using Visual Studio 2010

with .NET 2.0, later in this chapter. You cant unconvert. You can restore your backups, however, and discard the converted application if you dont like the results.

What are alternatives to upgrading?


You have several alternatives to performing an outright upgrade of your application to Visual Studio 2010: If it aint broke . . . . You may not have any compelling reason to upgrade your Visual Studio 2002, 2003, 2005, and 2008 applications to Visual Studio 2010. Unless you plan to take advantage of the new Visual Studio 2010 features in your Visual Studio 2002, 2003, 2005, and 2008 applications, you probably dont need to upgrade. Go side by side. You can run all versions of the .NET Framework and Visual Studio on a single computer. Your existing version applications then work alongside any new version 4.0 applications you create. Step up to the 4.0 framework. Chances are that your .NET applications will run on the 4.0 framework, even without converting them to work with Visual Studio 2010. You can take advantage of the new security and performance features of .NET 4.0 without touching your code. Mix and match. If you have relatively stable parts of your application that use previous versions of the .NET Framework and you want to do new development in Visual Studio 2010, you can mix and match. Just reference your older components in your new Visual Studio 2010 solution. Take the brute-force approach. You can manually re-create your applications in Visual Studio 2010 by choosing to copy and paste your old code into newly created Visual Studio 2010 solutions. Indulge in the best of both worlds. You can target the .NET 2.0 and 3.5 runtimes with your existing applications in Visual Studio 2010. I show you how in the Using Visual Studio 2010 with .NET 2.0, later in this chapter.

How do you upgrade from pre-.NET languages?


This chapter assumes that youre converting from a previous version of the .NET Framework to the current version. If youre upgrading from a pre-.NET language, such as Visual Basic 6, then youll need to jump through a few hoops to get your application converted. After theyre converted, youll still likely need to finesse the converted code to make it work.

116

Considering Your Conversion Strategies

You may be able to reuse stable components created in Visual Basic 6.0 by using a feature of the .NET Framework called COM Interop. With COM Interop, you can consume your Visual Basic 6 code from your .NET applications. In the case of ASP.NET, you have additional considerations when you choose to upgrade to Visual Studio 2010 and ASP.NET 4.0: ASP.NET uses a new, simplified model for managing resources, such as code and Web pages. Project files are no longer needed because all the configuration settings are moved to web.config, an XML-based configuration file. If youre really attached to using project files, you can use the Web Application Projects extension for Visual Studio 2005. Download the extension for free from Microsofts Web site at http://msdn2. microsoft.com/asp.net/aa336618.aspx. This extension still works with Visual Studio 2010. You can execute your Web sites on local development machines by using the ASP.NET Developer Server. Using the ASP.NET Developer Server requires less configuration and is more secure than using Internet Information Services (IIS) as your local Web server. ASP.NET 4.0 offers a new code-behind model, new controls for laying out Web pages and working with data, and improved deployment

options. Your productivity is greatly improved with ASP.NET 4.0. See Book III for more information on creating Web applications with ASP.NET 4.0.

You might also like