NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
christian_w
Posts: 160
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: 3,566
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

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?

Member
christian_w
Posts: 160
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: 24
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: 173
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: 2,832

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.

Member
christian_w
Posts: 160
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.

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page