LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Try to load CLR 2.0 by LabVIEW 2020

Hello!

I have an old assembly built a while ago targeting CLR v2.0.50727. My Win10 has LabVIEW 2020. 

My colleague created an executable back in 2010 which still works fine in my computer. But when I tried to run his LabVIEW code in development environment, the error message pops out: 

 

"(System.Runtime.InteropServices.MarshalDirectiveException: Invalid PInvoke calling convention. Thiscall requires that the first parameter is present and can be enregistered.) <append><b>System.Runtime.InteropServices.MarshalDirectiveException" 

 

Since his executable still works, I assume nothing wrong with his assembly. My guess is LabVIEW 2020 load CLR 4.0 by default and somehow this create the problem. I tried to load .NET 2.0 by the methods I found:

https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/configuring_clr_version/

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YIQoCAO&l=en-US

 

I created two configuration files: one for my lvproj file, and one for LabVIEW.exe. But .NET Assemblies in Memory still shows LabVIEW is using CLR version 4.0.30319.4200. I still have the same error message...

 

Please help...I'm running out of idea. Appreciate any comment!   

 

0 Kudos
Message 1 of 4
(1,093 Views)

I also tried to use LabVIEW 2012 since earlier version supposed to load CLR 2.0 by default.  But somehow my LabVIEW 2012 still loads newer version of 4.0.... Can anyone help?

0 Kudos
Message 2 of 4
(1,015 Views)

I've tried both approaches with no luck. Interestingly, if I intentionally type incorrect attributes in the configuration file, my labview 2012 starts with CLR 2.0.507278 version but in evaluation mode with no license. But with a correct attributes in the configuration file, my license is ok (through company volume license), but labview 2012 starts with CLR 4.0 version. Does labview 2012 somehow check the license and force running newer CLR version? 

0 Kudos
Message 4 of 4
(926 Views)