If you want to use .NET 4.0 assemblies in LabVIEW, you must explicitly configure LabVIEW to use the Common Language Runtime (CLR) 4.0. However, consider the following caveats before installing the suggested configuration file:
- LabVIEW does not support some .NET 4.0 features. Therefore, some .NET 4.0 assemblies might return errors in LabVIEW even if you configure LabVIEW to load them. Refer to the KnowledgeBase at ni.com for a list of unsupported .NET features in LabVIEW.
- Assemblies that are targeted to earlier versions of the CLR might behave unexpectedly if you configure LabVIEW to load the CLR 4.0.
- You must always use the CLR 2.0 to build a .NET interop assembly with LabVIEW.
Complete the following steps to force LabVIEW to load .NET 4.0 assemblies.
- Install the .NET 4.0 Framework on your development machine.
- Open a text editor and create a configuration file that contains the following text:
<?xml version ="1.0"?>
- Save this new configuration file in the same directory as LabVIEW.exe. Name the file LabVIEW.exe.config.
- Relaunch LabVIEW.
Now LabVIEW can load .NET 4.0 assemblies.
|Note If you build a stand-alone application from a LabVIEW VI or project that uses .NET 4.0 assemblies, the user of your application must install the .NET 4.0 Framework 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.|