LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview calling C# DLL

Hello,

I am having a problem with calling a C# DLL that created using Visual Studio 2005.  The problem is that when I use a .net constructor node I am able to see my class, but not the class constructor or any of the methods.  I found that this problem occurs for some reason due to an xml parsing method that is in my DLL.  When I remove or comment out that method and re-build my dll, my constructor node shows up and I can access all other methods in my dll.  Unfortunately, the method is an important part of the program I am trying to create and I am not sure why it is causing problems for labview.

The method that I comment out to get things to work involves using  functions from an xml parsing dl (mvp xml to be exact), which was included as a refence in my C# project.  If I reference a C# dll that reference another DLL, do I have to do something special in labview?  I'm not really sure what is causing this issue and any help would be appreciated.

0 Kudos
Message 1 of 4
(3,586 Views)

Hi JMas,

      I don't know what's going on here, however, I'd try placing the "secondary" DLL

- beside the .VI that calls the "primary" DLL

- in <Windows>\system32

or

- beside the primary DLL

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 4
(3,560 Views)
Hi JMas,

If your assembly was built against some other 3rd party assembly, then you definitely need to have this 3rd party assembly in a location that the .NET CLR can find it.  The best practice when using .NET assemblies in LabVIEW is to use LabVIEW projects and store the assemblies in the root directory of the LabVIEW project. Then make sure you add any VIs that use those .NET assemblies to your LabVIEW project. Refer to the How LabVIEW Locatest .NET Assemblies KnowledgeBase for more information.

Hope this helps!

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 3 of 4
(3,549 Views)
Thank you very much! Creating the labview project  in the same directory as my application and dll files worked.
0 Kudos
Message 4 of 4
(3,523 Views)