LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a .NET 6 DLL wrapped inside a .NET-Standard/Framework DLL

I have to establish a device Comunication using a .Net 6 Librarry.

I know I can't reference it directly, and so I thought I write my own Wrapper in .Net Standard 2 or .net Framework

My wrapper works, if I try to use it from a Console Application

 

In LabVIEW i get following Error:

Constructor Node Error creating instance of WrapperTest in assembly WrapperFrameworkTest.WrapperTest, WrapperFrameworkTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, (System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)) <append><b>System.IO.FileLoadException</b> in Hudson PH Meter.lvlib:Hudson PH Meter.lvclass:Hundson Wrapper Test VI.vi

 

To solve this problem, I thought I check where my Test Console application(s)  looking for System.Runtime, Version=4.2.2.0

Followed up by a lot of confusion.

  • Test Console in .Net 6 -> uses System.Runtime, Version=6.0.0.0 -> obviously can't use that in LabVIEW
  • Test Console in .Net Standard 2.0 -> Some warnings -> automatic solved 4.2.2.0 dependencies with Version=4.1.2.0 -> if I try to use v 4.1.2 in Labview -> Warnig popup: The version of the assembly you requested was automatically promoted to a later version by the.NET runtime engine. -> automatically changes to 4.0.0.0 ?! -> resulting in same error, cant find 4.2.2.0...
  • Test Console in .net Framework  -> uses System.Runtime, Version=4.1.2.0 (no Warnings) -> if i try to use v 4.1.2 in Labview -> Warnig popup: The version of the assembly you requested was automatically promoted to a later version by the.NET runtime engine. -> automatically changes to 4.0.0.0 ?!? -> resulting in same error, cant find 4.2.2.0...

Trying to download 4.2.2.0 as Labview persists on using that version. -> It dosn't exist in nuget : /

 

 

Anyone any experience on how to solve this? 

In C# .NET it says it is fine to use a .NET 6 dll in .Net-Standard /Framework Applications. LabVIEW says it is fine to use .NET-Standard /Framework is this still true if i nest a .net 6 within?

0 Kudos
Message 1 of 2
(1,715 Views)

Hi PaulPascher

This error may be caused for different reasons. I have attached articles that can give solutions in this case. 

 

The first thing that I would like to mention is .NET Framework Version compatibility with LabVIEW. 

lhovs_0-1679401009069.png

If I have noticed right, you are using LabVIEW 2019, therefor the compatible .NET Framework version is 4.6.2. 

I didn't find any other compatibilities documents to ensure that 4.2.2.0 version is compatible. 

 

Also, I have found article about Error Loading .NET Assemblies in LabVIEWtry to go through this article to find an appropriate solution or hint. 


Regards)

________

Best way to thank is to give Kudos / Mark as a solution. 

0 Kudos
Message 2 of 2
(1,587 Views)