Creating an .licx File Without Visual Studio-Integrated Tools

Measurement Studio 2012 for Visual Studio 2010 Help

Edition Date: August 2012

Part Number: 372636F-01

»View Product Info
Download Help (Windows Only)

See Also


Microsoft .NET Framework language compilers embed Measurement Studio licenses into your assembly every time you build an assembly that references a Measurement Studio licensed class library. The compilers use License Compiler (Lc.exe) to do this. The input to License Compiler is a licenses.licx file that contains a list of licensed types and the assemblies that contain these licensed types. At compile time, License Compiler obtains licenses from Measurement Studio, which the .NET language compiler embeds into the assembly as a resource.

If you have not installed Measurement Studio Visual Studio-integrated tools, you must manually create and update the .licx file in order to compile your project.

Note: To determine if you have installed the Measurement Studio integrated tools, select Help»About Microsoft Visual Studio in Visual Studio. If NI Measurement Studio is listed under Installed Products, the integrated tools are installed. If you want to install the integrated tools, rerun the Measurement Studio installer. To change the Automatically Update Projects preference, go to Tools»Options and select Measurement Studio»General in the tree on the left. On the right, expand .NET Tools to display the Automatically Update Projects drop-down list.

Refer to Measurement Studio Licensed Class Libraries Behavior for more information on Measurement Studio licenses embedded in assemblies and the behavior of Measurement Studio licensed class libraries.

Manually Creating an .licx File

To manually license the Measurement Studio assemblies you must have a licenses.licx text file included in your project. If your project does not have a licenses.licx file, complete the following steps.

  1. Use a text editor to create an empty text file.
  2. Name the file licenses.licx, and place the file in the directory for your project.
  3. Right-click the licenses.licx file, and select Include in Project.
  4. Set Build Action to Embedded Resource in the Properties window for the file.
  5. Add and update all the Measurement Studio licensed types for the file as outlined in the following section.

Licensing Visual C++ CLR Projects in Visual Studio 2010

In Visual Studio 2010, if you create a Visual C++ CLR project and then add a Measurement Studio control, by default Visual Studio does not embed the license for the Measurement Studio control into the compiled application. As a result, you receive a LicenseException at run time. To work around this issue, you can manually set the licenses.licx file to build with the License Compiler by completing the following steps:

  1. Right-click on the project in the Solution Explorer.
  2. Select Build Customizations from the context menu.
  3. In the Available Build Customization Files pane, select the check box to add lc(.targets, .props) for your project. Click OK.
  4. Right-click on licenses.licx in the Solution Explorer, and select Properties.
  5. In the Property Pages, select General in the Configuration pane, then select License Compiler in the Item Type drop-down list. Click OK.

.licx File Entry

The following example shows the contents of a licenses.licx file with all the Measurement Studio licensed types included in it. For each licensed class in the assemblies referenced in your project, there is a single-line entry in the .licx file. The format of each entry is LicensedClass, FullyQualifiedAssemblyName. The format of <FullyQualifiedAssemblyName> is assembly name, version of the assembly, culture of the assembly, and the public key token of the assembly.

For example, in the first line of the example .licx file contents, NationalInstruments.UI.WindowsForms.WaveformGraph is the licensed class, NationalInstruments.UI.WindowsForms is the licensed assembly, Version=9.1.40.111 is the version of the assembly, Culture=neutral provides the culture (locale) of the assembly, and PublicKeyToken=dc6ad606294fc298 provides the public key token of the assembly.

You can copy and paste this example into the licenses.licx file for your application; however, the Version value and the PublicKeyToken are not necessarily correct, so you must update Version and PublicKeyToken before you use this information in the licenses.licx file for your application.

Windows Forms Example

 
NationalInstruments.UI.WindowsForms.WaveformGraph, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Thermometer, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Tank, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Switch, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Slide, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.ScatterGraph, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.PropertyEditor, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.IntensityGraph, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.NumericEdit, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Meter, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Legend, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Led, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Knob, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.Gauge, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.DigitalWaveformGraph, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.ComplexGraph, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Tdms.TdmsLicenser, NationalInstruments.Tdms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Net.DataSocketSource, NationalInstruments.Net, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Net.DataSocketServer, NationalInstruments.Net, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Net.DataSocket, NationalInstruments.Net, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.NetworkVariable.WindowsForms.NetworkVariableDataSource, NationalInstruments.NetworkVariable, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.NetworkVariable.WindowsForms.NetworkVariableBrowserDialog, NationalInstruments.NetworkVariable, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.NetworkVariable.NetworkVariableLicenser, NationalInstruments.NetworkVariable, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.LedArray, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.SwitchArray, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.NumericEditArray, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.InstrumentControlStrip, NationalInstruments.UI.WindowsForms, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Restricted.AnalysisLicenser, NationalInstruments.Analysis.Enterprise, Version=9.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298

WPF Example

For WPF controls, you need each entry in the following example that is at or below your current license. For example, if you have Measurement Studio Professional, you must include both the NationalInstruments.Controls.Internal.WpfProfessionalLicenser entry and the NationalInstruments.Controls.Internal.WpfStandardLicenser entry. As with the Windows Forms example, the Version value and the PublicKeyToken are not necessarily correct, so you must update Version and PublicKeyToken before you use this information in the licenses.licx file for your application.

Here are the entries you can copy and paste into your licenses.licx file:

 
NationalInstruments.Controls.Internal.WpfEnterpriseLicenser, NationalInstruments.Controls, Version=12.0.40.207, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Controls.Internal.WpfProfessionalLicenser, NationalInstruments.Controls, Version=12.0.40.207, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Controls.Internal.WpfStandardLicenser, NationalInstruments.Controls, Version=12.0.40.207, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Tdms.TdmsLicenser, NationalInstruments.Tdms, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Net.DataSocketSource, NationalInstruments.Net, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Net.DataSocketServer, NationalInstruments.Net, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Net.DataSocket, NationalInstruments.Net, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.NetworkVariable.WindowsForms.NetworkVariableDataSource, NationalInstruments.NetworkVariable, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.NetworkVariable.WindowsForms.NetworkVariableBrowserDialog, NationalInstruments.NetworkVariable, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.NetworkVariable.NetworkVariableLicenser, NationalInstruments.NetworkVariable, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.LedArray, NationalInstruments.UI.WindowsForms, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.SwitchArray, NationalInstruments.UI.WindowsForms, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.NumericEditArray, NationalInstruments.UI.WindowsForms, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.UI.WindowsForms.InstrumentControlStrip, NationalInstruments.UI.WindowsForms, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
NationalInstruments.Restricted.AnalysisLicenser, NationalInstruments.Analysis.Enterprise, Version=12.1.40.111, Culture=neutral, PublicKeyToken=dc6ad606294fc298
Note: The Analysis assembly on the last line of the examples is dependent on which edition of Measurement Studio you have installed. In the examples, the Analysis assembly name is NationalInstruments.Analysis.Enterprise, which represents the Analysis assembly name that is installed with the Measurement Studio Enterprise edition. If you have the Measurement Studio Professional edition installed, the Analysis assembly name is NationalInstruments.Analysis.Professional, and if you have the Measurement Studio Standard edition installed, the Analysis assembly name is NationalInstruments.Analysis.Standard.

See Also

WAS THIS ARTICLE HELPFUL?

Not Helpful