I am trying to use the Tdms library and have included the following by following the sample code
I get the following compile error
The type or namespace name 'Tdms' does not exist in the namespace 'NationalInstruments
Solved! Go to Solution.
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?
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
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.
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).
I've been poking around myself, because I kind of need this solved. In doing so, I found this:
It says that "unlicensed exceptions" in VC++ projects are a known issue in MS2013, and gives instructions for a workaround. Hope that helps somewhat.
Ah. In that case, here's what I'm working on figuring out:
...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.
...which tells how to find the appropriate version (mine is 126.96.36.199) 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...
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.
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=188.8.131.52, Culture=neutral, PublicKeyToken=4febd62461bf11a4