Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Loading .NET 2.0, 3.0, and 3.5 Assemblies in LabVIEW

LabVIEW 2014 Help

Edition Date: June 2014

Part Number: 371361L-01

»View Product Info
Download Help (Windows Only)

The .NET Framework 4.0 allows you to load pure managed assemblies built in any version of the .NET Framework and mixed-mode assemblies built in .NET 4.0. Although LabVIEW loads the .NET Common Language Runtime (CLR) 4.0 by default, you can force LabVIEW to use the CLR 4.0 to load .NET mixed-mode assemblies that target the CLR 2.0.

Note  The .NET Frameworks 2.0, 3.0, and 3.5 each use the CLR 2.0. However, you cannot configure LabVIEW to use the CLR 2.0. Assemblies that target older versions of the CLR run in the CLR 4.0 and might behave unexpectedly.

To enable the following objects to load .NET mixed-mode assemblies that target the CLR 2.0, you must use the configuration file described below:

  • LabVIEW 2013
  • An executable built in LabVIEW 2013
  • An executable built outside of LabVIEW that calls into an interop assembly or DLL built in LabVIEW

Complete the following steps to configure LabVIEW to load .NET mixed-mode assemblies that target the CLR 2.0:

  1. Open a text editor.
  2. Copy the following text into the text editor:

    <?xml version ="1.0" encoding="utf-8" ?>
    <configuration>
       <startup useLegacyV2RuntimeActivationPolicy="true">
          <supportedRuntime version="v4.0.30319"/>
       </startup>
    </configuration>


  3. Save this new configuration file in the same directory as LabVIEW.exe. Name the file LabVIEW.exe.config.
  4. Relaunch LabVIEW.

Now LabVIEW can load .NET mixed-mode assemblies that target the CLR 2.0.

Note  If you build a stand-alone application from a LabVIEW VI or project that uses .NET 2.0 mixed-mode assemblies, the user of your application must install the .NET Framework 2.0 on his system and place a configuration file named application name.exe.config in the same directory as the application. The text of this configuration file must be the same as the text of the configuration file in step 2 of the previous procedure. To prevent the user from having to create his own configuration file, consider building an installer that includes the configuration file.

 

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