Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NationalInstruments.Tdms in .net 5?

Hello guys,

I'm currently trying to use the Tdms assembly in my .net 5. project, the problem is when i try to use the assembly i get following exception.

image.png

Is there actually a way to use the Tdms assembly in dot net 5 or are you guys also facing this issue? 

I have already tried to add the System.Web assembly manually to my project but that doesn't make any difference. 

With .Net Framework i'm not getting this exception.

 

0 Kudos
Message 1 of 7
(820 Views)

Needed to recreate 9 Projects with .Net Framework to get it running.

I hope NI will add .net core support soon, as .net core released since 2016 now. 

0 Kudos
Message 2 of 7
(781 Views)

Hi.

 

I have similar issue when try to use NI network variable in .NET 6 based ASP.NET Core web application. This code is OK in the old .NET 4.8 framework.

Ylts_0-1640081234207.png

BR,

Ilkka

0 Kudos
Message 3 of 7
(731 Views)

Hey,

 

sorry for the late replay, but I think the easiest way to get it running, is using the .Net Framework, if that is not possible for yourproject, you might be able to create a little .Net Framework 4.8 console application that will be called by the .Net 6 Web Application and writes the Network Variables to an text file.

0 Kudos
Message 4 of 7
(671 Views)

Hi, thank you for your reply. Our application runs in .NET 4.8 at the moment. That is no problem.

 

Yes, I can make a wrapper around .NET 6 incompatible stuff.

Or maybe NI Network variable can be replaced by gRPC:

 

https://grpc.io/

 

We use DAQmx and other NI libraries in many projects so there is a long way until everything runs on .NET 6. 😉

BR, Ilkka

0 Kudos
Message 5 of 7
(665 Views)

If all you are doing is reading TDMS files in .NET 6, I have a free and open-source library just for that: https://github.com/mettekou/FSharp.Data.Tdms#fsharpdatatdms-. While it is written in F#, it can be called from C# as if it were C# code. Alternatively, the free and open-source https://github.com/mikeobrien/TDMSReader targets .NET Standard 2.0 and will therefore work on .NET 5 and 6. Support for reading DAQmx data or writing TDMS files is not in either library yet, but if you have a need for it, please create an issue on the respective GitHub pages and I will have a look.

Message 6 of 7
(613 Views)

Thank you, that's good to know. Actually I need to write data to TDMS files. But I managed to use the NI TDMS dll, as I converted my projects to .Net Framework.

 

0 Kudos
Message 7 of 7
(593 Views)