NI Home > Community > NI Discussion Forums

LabVIEW

Reply
Active Participant
christian_w
Posts: 200
0 Kudos

VIAssemblyException "Failed to call InitLVClient function."

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 ?

 

Best regards

Christian

 

 

 

Trusted Enthusiast
Norbert_B
Posts: 4,435
0 Kudos

Re: VIAssemblyException "Failed to call InitLVClient function."

Christian,

 

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,

Norbert

----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Member
Wurth_ICS
Posts: 7
0 Kudos

Re: VIAssemblyException "Failed to call InitLVClient function."

I just installed LabVIEW 2011, and I still get this problem "Failed to call InitLVClient function".  Did you ever figure this out?

Active Participant
christian_w
Posts: 200
0 Kudos

Re: VIAssemblyException "Failed to call InitLVClient function."

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.

 

Christian

Member
Wurth_ICS
Posts: 7
0 Kudos

Re: VIAssemblyException "Failed to call InitLVClient function."

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!

Member
caleyjag
Posts: 29
0 Kudos

Re: VIAssemblyException "Failed to call InitLVClient function."

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.

 

Member
Mac671
Posts: 195
0 Kudos

Re: VIAssemblyException "Failed to call InitLVClient function."

Used LV 2011 SP1 , VS Studio 2010 ( Express ) .NET 4.0 and I get this message.

 

Is there any hope? 

Trusted Enthusiast
nathand
Posts: 3,715

Re: VIAssemblyException "Failed to call InitLVClient function."

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/lvhowto/building_a_net_assembly/ and http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/net_defaults/#compatible explaining that LabVIEW uses CLR 2.0, and the MSDN compatibility chart showing that .NET 4.0 uses CLR 4.0.

Active Participant
christian_w
Posts: 200
0 Kudos

Re: VIAssemblyException "Failed to call InitLVClient function."

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.