Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime exception when compiling in "Release" build configuration

Hello,

 

i've created an program (Visual Studio 2013) using Measurement Studio 2015 that contains the license.licx and some National Instruments .dlls such as NationalInstruments.Common.dll, NationalInstruments.Controls.dll, NationalInstruments.Tmds.dll etc.. The intention of this program is simply to export some data in tdms format. As long as i use "Debug" as configuration for the build process in Visual Studio everything works fine. The compiled program works on my computer (Measurement Studio 2015 installed) and on my colleagues computers as desired. If i change the build configuration to "Release" the program compiles with no error but works neither on my computer (Measurement Studio 2015 installed) and nor on any computer where Measurement Studio is not installed. After starting the program i get an exception with the following stacktrace:

 

System.ComponentModel.LicenseException: NationalInstruments.Tdms.TdmsLicenser is unlicensed.
   bei NationalInstruments.Restricted.LicenseBase.ShowUnLicensedBehavior(Type type, Object instance)
   bei NationalInstruments.Restricted.LicenseBase.a(Type A_0, Object A_1)
   bei NationalInstruments.Restricted.LicenseProviderBase.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
   bei System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
   bei System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
   bei NationalInstruments.Tdms.TdmsLicenser..ctor()
   bei NationalInstruments.Tdms.TdmsFile..ctor(String path, TdmsFileOptions fileOptions)

 

As you can see in my license file, the TdmsLicenser is listet as shown in your manuals and support pages:

# The following section of this file was auto-generated by Measurement Studio.  Do not edit or remove this file from the project.
# This file is used for licensing Measurement Studio components.
# Begin Measurement Studio licenses
NationalInstruments.Controls.Internal.WpfProfessionalLicenser, NationalInstruments.Controls, Version=15.0.45.3898, Culture=neutral, PublicKeyToken=4febd62461bf11a4
NationalInstruments.Controls.Internal.WpfStandardLicenser, NationalInstruments.Controls, Version=15.0.45.3898, Culture=neutral, PublicKeyToken=4febd62461bf11a4
NationalInstruments.Tdms.TdmsLicenser, NationalInstruments.Tdms, Version=15.0.45.49153, Culture=neutral, PublicKeyToken=4febd62461bf11a4
# End Measurement Studio licenses

 

I tried several hints and workarounds that i found online without success. It would be very nice if you could help me with this issue. Due to the fact that everything works fine with "Debug" as build configuration, i assume that i did not make that much wrong.

 

Best regards

Alexander

0 Kudos
Message 1 of 3
(2,887 Views)

Hello,

 

Just a quick though - do you use MS 2013 Standard? The TDMS class libraries are only included with Professional or Enterprise Editions.

 

 

Best Regards,
TK
Certified LabVIEW Architect (CLA)

0 Kudos
Message 2 of 3
(2,781 Views)

Hello n_dakota,

 

thank you for your reply! I'm using Measurement Studio Professional Edition 2015. As you can see in my post i created an application that uses the TDMS class libraries and works great as long as i compile the application in "debug" mode in visual studio. As soon as i switch the build configuration to "release" the application throws an exception at runtime.

 

Best regards

Alexander

0 Kudos
Message 3 of 3
(2,776 Views)