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.
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:
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.|
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.
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
|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|
|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.|