03-25-2026 01:46 AM
LabVIEW 2020 (working scenario)
LabVIEW 2026 (issue)
.NET Framework 4.7 (old)
.NET 8 (new)
Visual Studio 2022
In LabVIEW 2020, I was able to:
Reference a .NET Framework 4.7 DLL
Use custom interface types (e.g., ICalculator, IProbeAdjusterView) as VI inputs
Build a .NET Interop Assembly from LabVIEW
The generated assembly preserved the same .NET types
Example (LabVIEW 2020 generated method):
public static void Calculations(DataTransferObjects dto, ICalculator calculator)
This worked perfectly — I could pass actual C# objects from my application.
I upgraded the same concept to .NET 8.
Steps:
Created a .NET 8 class library with:
DTO class (DataTransferObjects)
Interface (ICalculator)
Referenced this DLL in LabVIEW 2026
Created a VI using these types as inputs
Built a .NET Interop Assembly
The generated method signature is now:
public static void Calculations(
NationalInstruments.LabVIEW.Refnums.LVBaseRefnum dto,
NationalInstruments.LabVIEW.Refnums.LVBaseRefnum calculator)
👉 All custom .NET types are replaced with LVBaseRefnum
I cannot pass my C# objects anymore:
Multiply.Calculations(dto, calculator); // ❌ compile error
LabVIEW expects LVBaseRefnum, but:
These cannot be created in C#
They are LabVIEW-owned references
I tried a dictionary-based mapping approach:
ConcurrentDictionary<LVBaseRefnum, object>
But:
I cannot obtain valid LVBaseRefnum instances from C#
Mapping cannot be established reliably
When trying to invoke the LabVIEW method, I get:
👉 LabVIEW Error 1776
This seems related to:
Type mismatch
Invalid refnum
or .NET 8 interop limitations
public interface ICalculator
{
double Multiply(double a, double b);
}
public class Calculator : ICalculator
{
public double Multiply(double a, double b) => a * b;
}
public class DataTransferObjects
{
public double X { get; set; }
public double Y { get; set; }
}
public static void Calculations(LVBaseRefnum dto, LVBaseRefnum calculator)
Is this behavior expected in LabVIEW 2026 with .NET 8?
Is there any way to:
Preserve original .NET types (like in LabVIEW 2020)?
Can LabVIEW generate interop assemblies that expose .NET 8 interface types?
How are we supposed to pass complex objects (interfaces/DTOs) across this boundary now?
Is LVBaseRefnum the only supported mechanism in .NET 8 interop?
If so, how can we correctly obtain and manage LVBaseRefnum from C#?
Simple types (e.g., double, string) work fine.
Example:
public static double Multiply(double a, double b)
👉 Works without issues.
Looking for:
Recommended architecture for LabVIEW 2026 + .NET 8 interop
Best practice to replace interface-based design used in .NET Framework
Clarification if this is a limitation or a configuration issue
Any guidance or working examples would be highly appreciated.