Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all articles
Browse latest Browse all 2011

Runtime exception when compiling in "Release" build configuration

$
0
0

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


Viewing all articles
Browse latest Browse all 2011


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>