Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Requirements for Using .NET Assemblies in LabVIEW

LabVIEW 2011 Help

Edition Date: June 2011

Part Number: 371361H-01

»View Product Info

Whether you want to create and manipulate .NET objects in LabVIEW or use LabVIEW to build .NET interop assemblies for other applications to use, you must adhere to the following default requirements and settings.

Compatible Common Language Runtime (CLR)

To create and manipulate .NET objects in LabVIEW, you must install a version of the .NET Framework that uses the CLR 2.0. Do not confuse the CLR version with the version of the .NET Framework. .NET 2.0, 3.0, and 3.5 all use the CLR 2.0 and are therefore CLR-2.0-compatible. Refer to the Microsoft Developer Network (MSDN) for more information about how the version of the CLR relates to the version of the .NET Framework.

Note  You can configure LabVIEW to load .NET assemblies in the CLR 4.0. However, National Instruments recommends developing .NET client applications that use a CLR-2.0-compatible version of .NET whenever possible.

LabVIEW uses the CLR 2.0 to:

  • Load assemblies—LabVIEW can load assemblies that target either the loaded version of the CLR or an earlier version of the CLR.
  • Build stand-alone applications, shared libraries, packed project libraries, source distributions, ZIP files, and .NET interop assemblies—LabVIEW targets these applications to the version of the CLR that LabVIEW is using. Do not configure LabVIEW to use the CLR 4.0 if you are building a .NET interop assembly.

Compatible Class Libraries

LabVIEW has access to the class library assemblies associated with the latest CLR-2.0-compatible .NET version installed on the development computer. The class library assemblies of the .NET Framework determine which .NET features are available to LabVIEW applications. If you build an application from a LabVIEW project or VI that relies on class library assemblies, National Instruments recommends that the target computer for the application have the same version or later of the .NET Framework installed.

Note  Later versions of the .NET Framework contain the contents of the class library from earlier versions of .NET. This construction enables some backwards compatibility. For example, if you develop a LabVIEW application using .NET 3.5 that relies only on class library features that existed in .NET 2.0, that application can run on a target computer that has any CLR-2.0-compatible version of .NET installed. Refer to the Microsoft Developer Network for a list of class library features that correspond to each version of the .NET Framework.

Unsupported .NET Features in LabVIEW

LabVIEW supports most language features of the .NET 2.0 Framework. However, .NET 4.0 introduces new features to the .NET CLR that LabVIEW does not support. Refer to the KnowledgeBase at ni.com for a list of .NET features that LabVIEW does not support.

Locations for Saving .NET Assemblies on Disk

You must save .NET assemblies that you want to call from LabVIEW in a location where LabVIEW can find them. Use the following guidelines to decide where to save assemblies.

Source of Assembly Call Location to Save the Assembly
VI within a LabVIEW project The project directory or any of its subdirectories
VI not within a project
Note  National Instruments strongly recommends that you always put VIs that use .NET objects in a project.
The directory that contains LabVIEW.exe
Built application When you build an application from a .NET client application, the LabVIEW Application Builder automatically saves assemblies that are not in the Global Assembly Cache (GAC) in the data subdirectory of the application directory. When you distribute the application, you must distribute the data directory along with the stand-alone application, shared library, or .NET interop assembly.
Multiple projects or applications Global Assembly Cache


To ensure that LabVIEW cannot access a particular assembly, remove the assembly from all of the locations in the previous table as well as the directories specified on the Paths page of the Options dialog box.

Refer to Loading .NET Assemblies for more detailed information about how LabVIEW locates .NET assemblies on disk.
Tip  If you encounter problems loading a particular assembly or accessing objects in an assembly, debug the assembly call or use to the .NET Assemblies in Memory dialog box to verify that the correct version of the assembly is in memory.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit