This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

How LabVIEW Locates .NET Assemblies

Updated Feb 21, 2019

Reported In

Software

  • LabVIEW

Issue Details

  • Where should I place my .NET assemblies (DLLs) so LabVIEW can locate them?
  • I am trying to separate my software from the C# libraries it uses so they can be uploaded separately.  Where can I put the C# libraries (.NET assemblies) so that the built LabVIEW program can still find them?

Solution

.NET requires that all assemblies either live in the Global Assembly Cache (GAC) or in the same directory or sub-directory of the application that's using those assemblies.

LabVIEW 8.0 and later meet these requirements by looking for .NET assemblies in the following locations:
  • Global Assembly Cache (GAC) - LabVIEW can access all assemblies in the GAC.
  • Specified subdirectories - If the VI is part of a LabVIEW project, LabVIEW searches the directory that contains the project and all subdirectories of that project. If the VI is not part of a LabVIEW project, LabVIEW searches the LabVIEW.exe directory. If you are using .NET assemblies in a shared library or stand-alone application, LabVIEW searches the directory that contains the library or application and the data and bin subdirectories.
  • Relative path - LabVIEW stores the relative path to the .NET assembly inside the VI (for non-GAC assemblies) and thus LabVIEW uses this path to search as well.
LabVIEW 7.x met these requirements by looking for .NET assemblies in the following locations:
  • Root directory of the top-level VI
  • Global Assembly Cache (GAC)

Note: National Instruments strongly recommends that you always put VIs that use .NET assemblies in a LabVIEW project and not leave them as stand-alone VIs.

For more information about using LabVIEW with .NET, refer to the Using .NET with LabVIEW help topic in the LabVIEW Help.

WAS THIS ARTICLE HELPFUL?

Not Helpful