Error Loading .NET Assembly In LabVIEW

Updated Jul 16, 2021

Reported In

Software

  • LabVIEW

Programming Language

  • C# .NET

Issue Details

When I open up an existing VI containing a .NET container I get the following error:

Control could not be loaded


Additionally when trying to insert an assembly into the container I get error:

​An error occurred trying to load the assembly.


How can I get my .NET controls to function as normal again?

Solution

There are 2 possible reasons you might be having this problem:
1. Your assembly can't be loaded as it is missing dependencies. To fix this ensure all dependencies are referenced correctly.
1.1 If the issue happens trying to open some third-party .NET control, some of these controls will require the .NET driver code to be in the same folder as the LabVIEW project code. Some .NET controls will allow the .NET driver code to be in a LabVIEW Project subfolder
1.2  If the issue happens trying to open some third-party .NET control in an executable, some of these controls will require the .NET driver code to be in the same folder as the executable.
 
2. You are trying to load a .NET file of a different bitness to the version of LabVIEW you are running. To fix this ensure you are trying to load the file using a LabVIEW version of the corresponding bitness.

Additional Information

This problem is usually caused my moving or renaming an assembly file from its installed directory. This often results in dependency issues and the .NET file can then not be loaded in the LabVIEW environment. If you are facing this issue after making edits to your .NET files it is recommended you re-install the libraries as this will often fix any dependency issues that arise.

Additionally, it is recommended you store any .NET files you are referencing from inside LabVIEW in the same directory as the one where the LabVIEW project is located.