Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

NationalInstruments.Tdms

Solved!
Go to solution

I am trying to use the Tdms library and have included the following by following the sample code

 

using NationalInstruments.Tdms;

 

I get the following compile error

 

The type or namespace name 'Tdms' does not exist in the namespace 'NationalInstruments

0 Kudos
Message 1 of 12
(12,475 Views)

Hi,

 

I have a few questions that will help narrow down the cause of not being able to ue the namespace. What version/package of Measurement Studio are you using (Standard, Professional, Enterprise)? Are you using C++? Have you ever been able to access that namespace on that computer before?

Evan See
National Instruments
0 Kudos
Message 2 of 12
(12,413 Views)

MS 2013 Enterprise edition.

 

No this is the first time I'm attempting to use TDMS.

 

C# Windows Form Application.

 

I was able to resolve the compile issue by:

 

1.  Right click on the project node in the Solution Explorer and click "Add Reference".
2.  In the Add Reference dialog box, choose the "Browse" tab.
3.  In this tab browse to the libraries referenced in  your program files, the path should be along the lines of  "C:\Program Files\National Instruments\MeasurementStudioVS2012\DotNET".

But now I get a run time error when accessing the library:

 NationalInstruments.Tdms.TdmsLicenser is unlicensed


Thanks

 

 

 

0 Kudos
Message 3 of 12
(12,411 Views)

Glad to see I'm not the only one having this issue.

 

For reference:  I'm using MS 2013 Enterprise, on an evaluation basis, and it's the first time I've tried to use it.  Visual Studio 2013, C#, Windows 7.  My project is WPF, but I'm getting the same message reported above about TdmsLicenser being unlicensed.

0 Kudos
Message 4 of 12
(12,405 Views)

I have to apologize a little for jumping in, because I found this thread via a search and did not at first notice that it was on a VC++ specific board (whereas, as I said, I'm using C#, which is a different animal). 

 

That said...

 

I've been poking around myself, because I kind of need this solved.  In doing so, I found this:

http://www.ni.com/white-paper/14475/en/#133384_by_Category 

 

It says that "unlicensed exceptions" in VC++ projects are a known issue in MS2013, and gives instructions for a workaround.  Hope that helps somewhat.

0 Kudos
Message 5 of 12
(12,381 Views)

Thanks for the input but to clarify

 

The original problem is with VS 2013 C# windows form application

0 Kudos
Message 6 of 12
(12,376 Views)

Ah.  In that case, here's what I'm working on figuring out:

http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/licensingnetwithoutintegratio...

...which told me how to check and see if the appropriate licensing tools were integrated into Visual Studio (they aren't, in my case) and how to create the necessary license file.

 

One note there, something I found confusing--where it gives step 3, "Right-click the licenses.licx file, and select Include in Project," it means to open your project, go to the Solution Explorer, and turn on Show All Files (one of the teeny buttons in the Solution Explorer toolbar).  Then you'll see the new .licx file in the Solution Explorer, which is where you should select Include in Project.

 

Followed by:

http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/updatinglicxfile/

...which tells how to find the appropriate version (mine is 13.0.45.242) but isn't a great deal of help with the public key token part.  I'm digging into that now, will report back if I find out what the heck it is and it actually works.

 

I'm beginning to wonder if part of the problem here is that MS2013 is made to work with VS2012 and we're using VS2013...

0 Kudos
Message 7 of 12
(12,374 Views)
Solution
Accepted by toma908

Got it!

 

See my previous posts for links to help with creating the license file for your project, adding it to your project, how to structure the entry for the TDMS licenser, and how to find what version of the NationalInstruments.Tdms.dll you're using.

 

For the public key token, find sn.exe on your computer.  It's probably somewhere like C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0a\Bin\x64\sn.exe, although I had to poke around in the \Microsoft SDKs\Windows directory to find exactly where it was.  (I found mine under v8.0, even though I'm running Windows 7...  Whatever.)  Once you've found it, open a command prompt window and browse to the directory where you found sn.exe.  Then run this command:

 

sn -Tp <full path of NationalInstruments.Tdms.dll>

 

Be sure to put the path in quotation marks.  That command should spit back a couple of things, one of which is the public key token.

 

I've got other problems in my program which need debugging, but this seems to have fixed the "unlicensed" issue for me, at least.  Hope that helps you too.

Message 8 of 12
(12,372 Views)

Great Job - Thanks.

 

Your solution works, I generated the key as you described then manually added the following line to the license file:

 

NationalInstruments.Tdms.TdmsLicenser, NationalInstruments.Tdms, Version=13.0.45.242, Culture=neutral, PublicKeyToken=4febd62461bf11a4

0 Kudos
Message 9 of 12
(12,363 Views)

Happy to help.  🙂

0 Kudos
Message 10 of 12
(12,361 Views)