DEVELOPER .NET PERSPECTIVES
This week, I'm continuing discussion of new features in Visual Studio .NET 2003 and Windows Server 2003 by looking at those new features that support the migration of existing code to the Windows .NET Framework. As I discussed in the past, Visual Studio .NET 2002 shipped with the Visual Basic Upgrade Wizard. If you open a Visual Basic (VB) 6.0 project in Visual Studio .NET, the wizard automatically launches and creates a new Visual Basic .NET project based on your VB 6.0 project. The Visual Basic Upgrade Wizard still exists in Visual Studio .NET 2003, but it has some new companions.
The first new companion is a tool that will be of great benefit to those people who use Active Server Pages (ASP) or Windows Script Host (WSH) and have their VB 6.0 code in scripts rather than VB projects. When you have VB 6.0 code in scripts, you can't use the Visual Basic Upgrade Wizard to convert the code to Visual Basic .NET. However, you can now use Visual Studio .NET 2003's new "Upgrade Visual Basic 6 Code" option to convert scripts.
To use this option, open a Visual Basic .NET project and select "Upgrade Visual Basic 6 Code" on the Tools menu. In the Upgrade Visual Basic 6 Code dialog box, paste your VB 6.0 code. If your script has any references to COM objects, select the References tab, click Add Reference, then select the appropriate reference in the Add Reference dialog box. Finally, click Upgrade to convert your code from VB 6.0 to Visual Basic .NET. After the conversion is complete, Visual Studio .NET 2003 inserts the updated code in your Visual Basic .NET project at the location where the cursor was at when you started the tool.
The Upgrade Visual Basic 6 Code option is a great tool for ASP developers because they can transition the HTML code associated with an ASP site to a new Visual Basic ASP.NET project, then use this option to upload the VB 6.0 code from the Web pages. The Upgrade Visual Basic 6 Code tool also does a great job converting WSH, Windows Management Interface (WMI), and Active Directory Service Interfaces (ADSI) scripts into code for Visual Basic .NET projects. Implementing your favorite scripts with a GUI lets you create many new powerful management tools. In addition, you can transform the scripts that you've been running with the scheduling service into true Windows services.
The second new companion converts Java code into Visual J# .NET code. Visual Studio .NET 2003 includes Visual J# .NET--Microsoft's Java syntax language--as part of the baseline installation. Visual J# .NET has been available as an add-on package for Visual Studio .NET 2002 for several months, so you might already be familiar with this .NET language. What's great about the inclusion of Visual J# .NET in Visual Studio .NET 2003 is that Visual Studio .NET now provides a seamless Upgrade Wizard for your Visual J++ 6.0 projects. If you open a Visual J++ 6.0 solution or project file in Visual Studio .NET 2003, the Upgrade Wizard automatically kicks off. This wizard opens your Visual J++ 6.0 project files and converts your Visual J++ project into a Visual J# .NET project.
The third new companion is the Java Language Conversion Assistant (JLCA), which converts Java code into Visual C# .NET code. A beta version of the JLCA has been available as a Microsoft Developer Network (MSDN) download for several months. With the release of Visual Studio .NET 2003, the JLCA is now part of the Visual Studio Integrated Development Environment (IDE). You can use the JLCA to convert not only Visual J++ projects but also Java (i.e., .jav and .java) source files into Visual C# .NET code.
To access the JLCA, go to the File menu and expand the Open submenu. Select the Convert option. The resulting dialog box lists both the JCLA and the Visual Basic Upgrade Wizard. If you select the JLCA, you have the option of either upgrading a Visual J++ 6.0 project file to Visual C# .NET project or a scanning a directory subtree and creating a new Visual C# .NET project based on the Java source files in the selected directory hierarchy.
The three new companion tools I just discussed are Visual Studio .NET 2003 enhancements related to helping you migrate existing scripts and projects to the Visual Studio IDE. Next week, I'll show you some of the enhancements related to Web Services.