Error Loading .NET Assemblies in LabVIEW 2013

Updated Nov 20, 2017

Reported In

Software

  • LabVIEW Full
  • LabVIEW 2013 Full
  • LabVIEW 2.2.1 Base
  • LabVIEW Base

Other

.NET Assemblies

Issue Details

When I try to load .NET assemblies in LabVIEW 2013, I receive one of the following error messages:

"An error occurred trying to load the assembly" 


"The version of the assembly you requested was automatically promoted to a later version by the .NET runtime engine"

 

Solution

LabVIEW 2013 uses the .NET 4.0 Framework by default, and will automatically promote assemblies targeted to earlier versions of the .NET Framework to a later version.
 

The .NET 4.0 Framework introduces a new security model. The new security model automatically grants full trust to local assemblies, but not to remote sources such as the Internet or network locations. LabVIEW returns an error when trying to load assemblies from remote sources without full trust.
 

To grant assemblies from remote sources full trust, you need to add a token to the .NET configuration file. To create a new .NET configuration file:
 

  1. Open a text editor and create a file that contains the following text: 

    <?xml version ="1.0"?>
    <configuration>
      <runtime>
        <loadFromRemoteSources enabled="true" />
      </runtime>
    </configuration>

     
  2. Save the file as LabVIEW.exe.config to trust all assemblies loaded into LabVIEW, or see LabVIEW Help: Configuring a .NET Client Application for more information about applying configuration files to LabVIEW Project files, shared libraries, or stand-alone executables.
  3. Place the LabVIEW.exe.config file in the same directory as the LabVIEW.exe file, which is typically located in C:\Program Files (x86)\National Instruments\LabVIEW 2013

Additional Information

For information about loading .NET 2.0, 3.0, or 3.5 assemblies, please see LabVIEW 2013 Help: Loading .NET 2.0, 3.0, and 3.5 Assemblies in LabVIEW. Please note it is suggested to use a LabVIEW project, rather than a stand-alone VI, when using .NET Assemblies.
 

Tip: In Windows 7 or later, you also can right-click the assembly and click Unblock on the General tab to grant an assembly full trust.
 

Note: If you use Parallels Desktop or VMWare Fusion to run Windows as a virtual machine, the new security model treats the shared directories (e.g. folders that begin with /psf or \\vmware-host\) as remote sources. You need to grant assemblies in these directories full trust.
 

Program Compatibility: This error may also occur when you attempt to use a 64-bit .NET DLL with a 32-bit version of LabVIEW.

WAS THIS ARTICLE HELPFUL?

Not Helpful