02-25-2022 08:07 AM
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?
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.
Solved! Go to Solution.
02-27-2022 12:25 PM
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?
02-28-2022 07:33 PM
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?
02-28-2022 08:52 PM - edited 02-28-2022 09:12 PM
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.
02-28-2022 10:43 PM - edited 02-28-2022 10:46 PM
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.
02-28-2022 11:11 PM - edited 03-01-2022 12:06 AM
I finally know why.
I forget to add "Public" in Class2 and Class3.