LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use C# other class

Solved!
Go to solution

I have one C# DLL. In C# dll, I have three Classes (Class1、Class2、Class3).

I through Labview .Net function use C# DLL. But I just see Class1, I don't see Class2 and Class3. I want to use Class2 and Class3 I need to do what?

JustTest_0-1645797504142.png 

JustTest_2-1645797540387.png

 

 

I add a new method in Class1. I want to use the new method. But through .Net function I can't see the new method, I just see the old method. 

 

 

 

0 Kudos
Message 1 of 6
(1,651 Views)

Are you using a LabVIEW Project?

Where do you put the .NET assembly on disk?

What happens when you re-start LabVIEW and re-open the VI?

0 Kudos
Message 2 of 6
(1,603 Views)

1. Yes

2. D Slot

3. When I restart I can see a new method, but still is not see other Classes.

     If I don't want to restart and I can immediately use a new method, I need to do what?

Download All
0 Kudos
Message 3 of 6
(1,583 Views)

Are Class2 and Class3 public classes (not private or internal)? 

 

Are they defined as non static (static classes do not have public constructors)?

 

Otherwise we'll take a look at your posted code.

0 Kudos
Message 4 of 6
(1,577 Views)
Solution
Accepted by topic author JustTest

I checked your assembly, and both Class2 and Class3 are defined with no access modifiers (and are thus implicitly internal by default).

 

Internal classes cannot be accessed outside the assembly https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifier... regardless of the application hosting the assembly.

 

Change them to public, recompile, and try accessing them in LabVIEW again.

Message 5 of 6
(1,570 Views)

I finally know why.

I forget to add "Public" in Class2 and Class3.

Message 6 of 6
(1,564 Views)