Creating .NET Framework Assemblies with LabVIEW

Create a .NET Framework assembly to bundle LabVIEW code into a .NET DLL that external .NET environments can call.

Note This build output requires Application Builder. LabVIEW Professional edition includes Application Builder. If you use another LabVIEW edition, you can purchase the LabVIEW Application Builder Module separately at ni.com.
Note The following information applies to .NET Framework only. Prior to LabVIEW 2025 Q1, .NET Framework assemblies were called .NET interop assemblies.

Before creating .NET Framework assemblies, do the following:

  • Install .NET Framework 4.0 on your development computer.
  • Create code to include in the .NET Framework assembly you create. Include the code in a project.
  • Prepare the source files for distribution.
  • Save the project. To create a build specification, the project must be saved.

You can also access LabVIEW classes through a .NET Framework assembly. LabVIEW can generate a .NET class for LabVIEW classes that you specify, and you access these .NET classes through a .NET assembly.

This procedure describes the basic options to create this build specification. For details on each configuration option for the build specification, refer to the links for each page of the dialog box.

To use your LabVIEW project to create a .NET Framework assembly, complete the following steps.

  1. To ensure that the LabVIEW Runtime can load all VIs in the .NET Framework assembly, include compiled code with all VIs:
    1. In the Project Explorer window, right-click the project and select Properties or select Project » Properties.
    2. Under Project, click Mark Existing Items..., select the VIs in the project, and select Unmark Selected Items.
  2. In the Project Explorer window, right-click Build Specifications and select New » .NET Framework Assembly.
  3. Required: Under Source Files, specify which project files to export as functions of the .NET Framework assembly.
    Note You must add certain VIs to the Always Included listbox on the Source Files page in the following situations:
    Item When to Always Include
    Dynamically loaded VIs

    You can also distribute dynamically loaded VIs for an application by including them within a source distribution.

    Custom run-time menus If you save the custom run-time menu for a front panel control as a separate run-time menu file (.rtm).
  4. (Recommended) Under Source File Settings, edit destinations and properties for the files and folders included in a packed project library.

    LabVIEW displays different options based on the type of item you select in Project Files.

  5. (Recommended) Under Information, name the .NET Framework assembly and the build specification, and choose the highest-level save directory for the build product.
  6. (Recommended) Under Destinations, configure destination settings for the .NET Framework assembly and any support files.

    Destination path defines the location of these files relative to the overall save directory for the build you specified in step 5.

    Note If you intend to include this distribution in an installer, specify the build output of the build specification relative to the primary destination of the build specification. For details, see Caveats and Recommendations for Building Installers with LabVIEW.
  7. Optional: Under Additional Exclusions, configure options to leave out certain items from the distribution.

    Excluding items can reduce the size of the distribution, improve load times, or reduce memory usage.

  8. Optional: Under Version Information, specify the version of the .NET Framework assembly and provide metadata about your organization.

    For more information about setting versions, refer to Managing Application Versions.

  9. Optional: Under Pre/Post Build Actions, define VIs to run before or after the build.
  10. Optional: Under Windows Security, configure security features, such as the digital signature and the manifest file for the .NET Framework assembly.
  11. Optional: Under Run-Time Languages, set the language preferences for items within the distribution, such as dialog boxes and menus.
  12. Optional: Under Advanced, configure settings for debugging, logging, signing, and compatibility.
  13. Optional: Under Preview, generate a preview of the build to ensure that it appears as you expect.
  14. Apply any updated settings for your build specification by clicking OK.
    The dialog box closes and the build specification name appears in the project under Build Specifications.
  15. Build the distribution.
    OptionDescription
    Interactive
    • Right-click the build specification and select Build.
    • From the Package window, click Build.
    Programmatic Use the Build VI or the ExecuteBuildSpec command line operation.