LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State of .Net Core in 2025Q3 / Bugs and Errors

Hi all,

 

I currently investigate the option to migrate one of our .Net libraries to .NET Core 8.0. In the process, I found some Bugs, Workarounds and Show-Stoppers, I would like to discuss.

 

First notable is the obvious and not documented incompatibility of "to more specific class" with .net objects. It will not accept any wire with .Net Core objects:

 

SpaghettiCoder_0-1758798141417.png

This can be somewhat worked around by using "Cast Type" and a "NaN/Path/Refnum" Check, which seems to work ok:

SpaghettiCoder_1-1758798260694.png

 

Another bummer is, that parameters / outputs with type DateTime / Timestamp seem to be broken. At runtime, the signature of the method with inputs is not recognized and returned timestamps are always "0". Here I would prefer to at least choose between the LV-Type and the .Net Object (right click -> "convert type").

SpaghettiCoder_3-1758798540885.png

Workaround is to return the datetime as "object" and convert it manually:

SpaghettiCoder_4-1758799690637.png

SpaghettiCoder_5-1758799717852.png

 

 

 

Other Problems:

  • obviously not usable are the vis "To .NET Object" and ".NET Object To Variant". These can be replaced with type inspection and conversion methods with every type.
  • Some methods with optional / nullable parameters seem to crash the .net core Host (1781 "Invoke Node niDotNETCoreInteropHost has terminated!"). This can only be restored by restarting LV.
  • Using .Net Event callbacks locks the library. The good old workaround (Solved: .net event callback VIs - Why do they never leave running state? - NI Community) does not work anymore

 

The good news is, the wrapper now seems to be stable and work (with a lot of try-and-error)

 

 

 

 

Message 1 of 6
(381 Views)

This !

Hope it will be fixed soon...

0 Kudos
Message 2 of 6
(235 Views)

I see this error when executing .net code that worked fine on net4.8:

 

Possible reason(s):

LabVIEW: (Hex 0x6F2) The specified method was not found in the .NET Core type.

 

No obvious reason and solution so far.

 

What is the procedure to debug .net core code with LV? In net4.8 i could simply attach to labview and set breakpoint in my .net code. 

0 Kudos
Message 3 of 6
(203 Views)

Seems LV is unable to handle arrays of structs and throws this exception:

 

public struct Signal
{
    public int Id {get;set;}
    public string Name {get;set;}
    public Direction Direction {get;set;}
    public SignalStrength Strength {get;set;}
    public DateTime Timestamp {get;set;}
    public double Frequency {get;set;}
    public double Amplitude {get;set;}
    public bool IsActive {get;set;}
    public string Description {get;set;}
}

public enum Direction
{
    Up,
    Down,
    Left,
    Right
}

public enum SignalStrength
{
    Weak,
    Medium,
    Strong,
    VeryStrong
}

public class SignalGenerator
{
    private readonly Random _random;
    private readonly string[] _signalNames = { "Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta" };
    private int _currentId;

    public SignalGenerator()
    {
        _random = new Random();
        _currentId = 1;
    }

    public Signal[] GetSignals(int count = 10)
    {
        var signals = new Signal[count];
        
        for (int i = 0; i < count; i++)
        {
            signals[i] = GenerateRandomSignal();
        }
        
        return signals;
    }

    private Signal GenerateRandomSignal()
    {
        return new Signal
        {
            Id = _currentId++,
            Name = _signalNames[_random.Next(_signalNames.Length)],
            Direction = (Direction)_random.Next(Enum.GetValues(typeof(Direction)).Length),
            Strength = (SignalStrength)_random.Next(Enum.GetValues(typeof(SignalStrength)).Length),
            Timestamp = DateTime.Now.AddSeconds(-_random.Next(0, 3600)),
            Frequency = _random.NextDouble() * 1000.0 + 100.0, // 100-1100 Hz
            Amplitude = _random.NextDouble() * 10.0, // 0-10
            IsActive = _random.Next(2) == 1,
            Description = $"Signal generated at {DateTime.Now:HH:mm:ss}"
        };
    }
}

 

When trying to read it from LV error is thrown:

 

pawhan11_0-1760966349257.png

 

Looks like a bug. Worked fine for net4.8

0 Kudos
Message 4 of 6
(150 Views)

Also for some constructors node is too long:

pawhan11_0-1760987730222.png

 

Looks kind of funny 🙂

0 Kudos
Message 5 of 6
(126 Views)

I appreciate this thread a place to keep track of some of these issues.  I've been working with the .NET core for a while now.  The first iteration was VERY buggy, but it seems to be getting better over time.

 

There's a thread over here:
https://forums.ni.com/t5/LabVIEW/LabVIEW-2025Q3-NET-core-memory-leak/m-p/4457731/highlight/false#M13...

 

About a memory leak which has been passed onto NI already.

 

I myself have mostly been working with other libraries from the open source world, which is where most of my issues have come from.  The main outstanding issue that I have, is that there just seem to be *some* libraries that don't work for some reason.  The main one I've seen this with is the StackExchange.Redis library -- a .NET library for communicating with redis.

 

When working with this library I get an error 1782 on first call, with seemingly no issues with the code.  It appears to happen at the "GetDatabase" method.

 

jyoung8711_0-1761318701853.png

jyoung8711_1-1761318718006.png

 

After this error occurs, the .NET interface just seems to be entirely broken and I get other 1782 and 1778 errors:

 

jyoung8711_2-1761318778902.pngjyoung8711_3-1761318785757.png

 

LabVIEW has to be entirely restarted before anything can usefully run again.

This same code runs just fine with .NET Framework libraries.

 

Two other things of note:

1. Many of the "common" data types/methods (which you could have found in mscorlib previously) are now in "Sysetm.Private.CoreLib"... like the GUID constructor:

jyoung8711_4-1761318914928.png

 

But sometimes this library causes other problems (e.g. I get an error that says "An error occurred trying to load the assembly").

 

2. In the latest patch the "Browse Methods..." button no longer works (which is a known issue, but probably worth mentioning).  Not a big deal some of the time.. .but in some circumstances, the method lists can be very long, and pretty painful without the browser.

 

 

 

 

0 Kudos
Message 6 of 6
(49 Views)