Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

This class contains no public constructor

Solved!
Go to solution

Please help! I have some problems with  .Net.  I am trying to call library by using the .NET constructor. I browse for my .dll and when selecting my class, the constructor displays: This class contains no public constructors, but not for the all objects. But this dll is on the GAC(C:\Windows\assembly). I thought that it is a static class and have tried to cause its method for a static class(invoke node- right mouse-select class - net - my method “open”(for example). But Run button is broken (no input reference). The object “Server” is most of all necessary to me (see pictures). It is not my library and I cannot change it.

LV 8.6.1, Windows XP

 

 

Download All
Message 1 of 6
(7,211 Views)
Solution
Accepted by topic author Mike23

More pictures.....

Download All
Message 2 of 6
(7,210 Views)

My dll....

0 Kudos
Message 3 of 6
(7,203 Views)

Hi Mike 23,

 

Since there are no public constructors you can only access static methods and LabVIEW indicates a static property and method with a [S] at the beginning of the property or method name (Using Static .NET Properties and Methods). In order for the assembly to work we need either a public constructor or static methods.  If the assembly does not have either it will not be usable.  I have tried to use the assembly that you provided and it will not load properly.

 

Thanks

Ryan T
National Instruments
Applications Engineer
Message 4 of 6
(7,152 Views)

I am Facing Same problem which accessing public class From .net dll. I Have Gone though forum they suggest to access though involked node or proporty node directlly rather then from contructor for such cases.

but when I am trying to access a Class though proporty node directlly my vi goes into error mode. As shown in Image-2. So How to resolve this error niether i am able to access these property though contructor.

I am Able to access though microsoft Visual studio 2010.

Brijesh Patel
Application Engineer,
Nutron Systems,
Ahmedabad
Message 5 of 6
(5,469 Views)

Hey Brijesh,

 

Have you looked at the information in the post above yours? It looks like the steps suggested there are also relevant for you. As stated above, if the assembly does not have either a public constructor or static methods then you cannot use it. Please and see the page linked in the comment above yours about using static properties and methods in LabVIEW. 

 

Regards,

Will

0 Kudos
Message 6 of 6
(5,461 Views)