If I try to call my LabView Interop Assembly in a .net framework 4.0 application I'll get an unhandled VIAssembly exception.
No problem with .net framework 3.5.
My config is LabVIEW2010SP1 and MS VisualStudio2010.
Can that be fixed ?
LabVIEW does not support .NET 4.0 directly. Following this KB .NET Framework 4.0: LabVIEW 2010 did not undergo any testing using assemblies targeting the CLR 4.0.
Sure, the rest of the KB does not refer to your issue, but this sentence is important. I am not sure if this has been addressed with LV 2010 SP1, but regarding to your experience, i would say: No.
hope this helps,
I just installed LabVIEW 2011, and I still get this problem "Failed to call InitLVClient function". Did you ever figure this out?
No, but I haven't installed the current LV version yet. It will take at least 2 weeks before I can test this again. Will post the result here.
So far I wrap the lvInteropAssembly to add COM functionality and this wrapped version is .net 4.0 compatible.
I decided to just give up. I'm implementing a vision development module project inside of a .NET 4 C# WPF application, so I ended up just putting all of my logic in C# rather than LabVIEW.
However, I am still interested in getting this to work for future projects, as I think this would be a really nice option... but it must work for .NET 4.0!
I am running into the same problem.
I made a Interop Assembly in LabVIEW 2011 SP1 and am trying to integrate it into Visual C# 2010 (.NET 4.0).
I'm getting the same error as the OP.
What is the advised solution? I can't use a different version of .NET.
No. LabVIEW does not yet support building an assembly for any version of the .NET framework later than 3.5. See http://zone.ni.com/reference/en-XX/help/371361H-01
To use a simple wrapper class for the LV interop assembly functions is an acceptable solution. This can be referenced/used within a pure 4.0 project without the LVClient error. It works for me since the last 3years.