Requirements for Using .NET Assemblies in LabVIEW

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2015 Help
LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help

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 use the .NET CLR 4.0. This version of the CLR is part of the .NET Framework 4.0 that installs with LabVIEW.

LabVIEW uses the CLR 4.0 to:

  • Load assemblies—LabVIEW can load .NET assemblies that target the .NET CLR 4.0 or earlier. However, LabVIEW loads all assemblies in the .NET CLR 4.0.
  • Build stand-alone applications, shared libraries, packed project libraries, source distributions, and ZIP files that contain VIs that use .NET functions or build .NET interop assemblies—LabVIEW targets these applications to the .NET CLR 4.0.

Compatible Class Libraries

LabVIEW has access to the class library assemblies associated with the .NET CLR 4.0, which installs with LabVIEW. 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 assemblies, the target computer for the application must have the .NET Framework 4.0 installed.

Unsupported .NET Features in LabVIEW

LabVIEW supports most language features of the .NET Framework 4.0. However, .NET Framework 4.0 introduces a few 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 the .NET Assemblies in Memory dialog box to verify that the correct version of the assembly is in memory.

WAS THIS ARTICLE HELPFUL?

Not Helpful