Measurement Studio Throws a Licensing Exception After Adding a New Library

Updated Jun 11, 2018

Reported In


  • Measurement Studio

Issue Details

I have added or am using a new library in NI Measurement Studio and am getting exceptions (seen as LicenseException or System.TypeInitializationException) thrown similar to 'NationalInstruments.UI.WindowsForms.Led is unlicensed'. I have already used the Measurement Studio .licx Utility to include licenses for my project to no avail.


There is a chance that the licenses generated were either generated for the incorrect version of .NET or they were added to the project incorrectly. To check what version of .NET you will need, open the reference properties in the Visual Studio Solution Explorer and check the version value:
In this section, the third version number corresponds to the version of .NET you will need. In this case, 45 corresponds to .NET 4.5 and 40 corresponds to .NET 4.0 and so on. There is a chance that you may require different versions to be generated in a single license file. Pay attention to this and copy-paste accordingly.

Once the correctly versioned licenses are added to the .licx file, be sure to manually add your .licx file to your project. Right click on your Project in the Solution Explorer and add your file to the solution. This should immediately license your NI software, but a restart of your IDE is never a bad idea when adding licenses. 


Additional Information

Additional licensing troubleshooting steps include:
  • Running your IDE as an administrator
  • Ensuring that your .licx file has Read/Write permissions enabled


Not Helpful