Visual Studio .NET -- The Latest Microsoft .NET Component

Publish Date: May 24, 2012 | 7 Ratings | 2.86 out of 5 | Print


On February 13, Microsoft released Visual Studio .NET, one of the crucial components of the .NET framework. Visual Studio .NET is the next generation application development environment for creating .NET components. It differs from previous versions of Visual Studio because it takes advantage of several new technology standards, such as the eXtended Markup Language (XML) and the Simple Object Access Protocol (SOAP), and offers more personalization and integration between multiple applications and devices.

In this article, we take a look at how Visual Studio .NET operates and how you can migrate your measurement and automation applications to Visual Studio .NET.

Table of Contents

  1. Visual Studio .NET Basics
  2. Visual Basic .NET Highlights
  3. Migrating Your Visual Basic 6.0 Applications to Visual Basic .NET
  4. NI Product Compatibility
  5. Conclusion

1. Visual Studio .NET Basics

Visual Studio .NET is designed as the tools component in the Microsoft .NET framework. It consists of Visual Basic .NET, Visual C++ .NET, and Visual C# .NET. You use this environment to develop source code in any .NET-compliant language that targets the .NET framework (class libraries). This results in a software component that you can use in any higher level application or Web service -- creating an open architecture.

However, with Visual Studio .NET, Microsoft changed the underlying technology on which their software is based. Instead of the COM model used by Visual Studio 6.0, Visual Studio .NET builds on SOAP and XML.

SOAP is a lightweight protocol built on XML for exchanging information in a decentralized, distributed environment. XML is a data language technology, and an increasingly popular standard, developed through the open Internet standards groups ( It provides data and information and describes the nature of data or the data type. With XML, you can use information in multiple applications or configure it appropriately within a Web browser or other display. SOAP is smaller and easier to implement than COM and most of the previous protocols because of its ability to call existing XML Parsers and HTTP libraries. By using SOAP (based on XML) instead of COM, you can link to disparate systems both internal and external to your organization.

Because of the integrated nature of the environment, you can access several tools and features from all .NET languages. The look and feel within all the languages is similar in the Visual Studio .NET environment. For example, you can access the toolbox and object browser from Visual Basic 6.0 in any .NET language. Because of this, you can easily explore Visual Studio .NET projects, references, and external libraries.

NI currently offers several products that have integrated XML features. With our test management software, National Instruments TestStand, you can generate XML-based test reports, which provide great flexibility for displaying test data in a variety of formats. You can also take advantage of the Database Connectivity Toolset for XML capabilities with NI LabVIEW and LabWindows/CVI. We discuss NI and Visual Studio .NET product compatibility later in this article.

See Also:
Know the Basics of Microsoft.NET
NI TestStand
LabVIEW Database Connectivity
World Wide Web Consortium

Back to Top

2. Visual Basic .NET Highlights

Microsoft built Visual Basic .NET from the ground up instead of retrofitting the existing code base to run on top of the .NET Framework. They made many changes to the Visual Basic environment to increase its performance and functionality, including:

  • Inheritance
  • Structured exception handling
  • XML Web services

Let's discuss these additions.

Microsoft designed Visual Basic .NET to be an easy and productive tool for creating .NET applications, including Windows applications, Web services, and Web applications. One new feature added to the Visual Basic language is Inheritance, which means classes can share methods with each other and provide method overloading. This means a class can have multiple methods of the same name using the parameter lists to distinguish which underlying code to call.

Visual Basic .NET also provides structured exception handling capabilities for improved error handling. With free threading, you can call any method or function from any thread at any time offering increased flexibility and helping make Visual Basic an object-oriented programming language. Visual Basic .NET integrates with the .NET framework and the Common Language Runtime (CLR), which together provide language interoperability, simplified deployment, enhanced security, and improved version support. You can also convert Visual Basic code modules into XML Web services, so you can invoke them across the Internet, from any language running on any operating system.

Back to Top

3. Migrating Your Visual Basic 6.0 Applications to Visual Basic .NET

While these new features (listed above) enhance the Visual Basic programming language, they are significant changes. Therefore, you may encounter some challenges upgrading to Visual Basic .NET from Visual Basic 6.0. In addition, you may experience some difficulty as a result of syntactical changes to the language itself.

Use Conversion Wizard
To help you migrate, Microsoft provides a tool (wizard) to assist with many of the incompatibilities between the two versions. The conversion wizard runs automatically when a Visual Basic 6.0 project is opened in Visual Studio .NET. This tool converts many of the previous Visual Basic data types to the new data types used in Visual Basic .NET.

For example, when opening a Measurement Studio 6.0 example that was written in Visual Basic 6.0 with the Visual Basic .NET wizard, you notice that the ActiveX controls are placed in an ActiveX wrapper. You can see an example of this below. This is the same behavior that you can expect to see with most ActiveX controls.

Figure 1. Microsoft's Visual Studio .NET Conversion Wizard -- Measurement Studio 6.0 Example in the Visual Basic .NET Environment

While the conversion wizard takes care of most of the object updates for you, it does not convert and translate all syntactical changes -- especially the variant data type. In addition, the conversion wizard only updates projects. If you have a project group or n-tier application, you need to first upgrade the client component and ensure its functionality. Once that is complete, continue upgrading each component in the hierarchy tree until you have upgraded the 'topmost' component.

Solve Remaining Errors
The conversion wizard can only upgrade about 95 percent of your application. You need to address any remaining errors manually before compiling the application. The majority of the modifications you should expect to encounter are behavioral and syntactical. For example, anything listed as 'Upgrade_ISSUE' is probably a compiler error and something you need to fix before compiling. If you see a warning in the task list, it normally indicates a behavioral error. You should address this as well. You may also encounter some architectural errors signifying that you need to architecturally change the component needs. These errors would result from using AutoRedo in Visual Basic 6.0, using Visual Basic 6.0 printing methods, or using form collections in your Visual Basic 6.0 application.

Follow Architectural Recommendations
To minimize the manual changes when upgrading in the future, Microsoft advises that Visual Basic developers begin following the set of suggested architectural recommendations and practices. Some suggested practices include -- using early binding of variables by accessing components in other applications at compile time rather than runtime, avoiding null propagation by including tests in your code to check for passing null values, using ActiveX Data Objects (ADO) for data access, avoiding the 'double' data type for storing dates, avoiding fixed-length strings in user-defined types, as well as using constants instead of underlying values.

Note that Microsoft has completely removed some unintuitive and inconsistent methods, such as GoSub/Return and DefInt, from the language. There is also a list of features that do not work at all in Visual Basic .NET. For example, the OLE control container does not work in Visual Basic .NET -- you need to replace it. Neither the ActiveX DTML nor the ActiveX Documents page applications can be translated into Visual Basic .NET. No migration paths exist for these functions. For a complete list of these incompatible features, see Microsoft's Visual Basic .NET Upgrade Recommendations below.

Finally, keep in mind that you don't have to migrate everything. If it works, keep it; integrate it whole into your system. Then, for new projects, you can begin development in the Visual Studio .NET environment and avoid any migration issues.

See Also:
Microsoft's Visual Basic .NET Upgrade Recommendations

Back to Top

4. NI Product Compatibility

NI Measurement Studio -- a components package that delivers integrated, native tools designed for measurement and automation into the Visual Studio environment -- offers Visual Studio .NET test and measurement programming components. Measurement Studio provides a collection of measurement controls designed to build virtual instrumentation systems inside Visual Basic or other ActiveX control containers. Measurement Studio also delivers an interactive design approach for developing measurement and automation systems inside Visual C++.

Because Measurement Studio is tightly integrated in the Visual Studio environment, it is naturally the NI product most closely aligned with Microsoft technology, and therefore the first to release native .NET tools. The Measurement Studio for Visual C++ .NET update includes all new application building wizards, new environment add-in tools to help you easily modify your Measurement Studio for Visual C++ .NET projects, and a new set of libraries compatible with the new versions of the Visual C++ .NET run-time libraries. Visual Basic .NET and Visual C# .NET work with controls in most cases. Because the .NET framework is not based on ActiveX technology, these controls are placed in a wrapper to function correctly within the Visual Studio .NET environment. For more information on Measurement Studio 6.0 controls in Visual Studio .NET, download our white paper, "Using Measurement Studio ActiveX Controls in Visual Studio .NET".

Figure 2. NI Measurement Studio 6.0 Controls within the Visual C# .NET Development Environment


See Also:
Using Measurement Studio ActiveX Controls in Visual Studio .NET

Back to Top

5. Conclusion

There is currently a wealth of knowledge and resources available on Example programs, application notes, knowledge bases, and white paper resources are all tools available to help you in your evaluation of the latest Microsoft technology. If you have any questions, comments, or ideas about Visual Studio .NET and the creation of measurement and automation applications, you can contact us directly, search the KnowledgeBase, or post a question in our online community.

See Also:
NI Developer Zone
Technical Support Search
Measurement Studio

Related Links:
Microsoft .NET FAQs
Measurement Studio Evaluation Software

Back to Top

Bookmark & Share


Rate this document

Answered Your Question?
Yes No