NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Static .net class within a namespace can't be called

I am having a little problem. I have a .Net DLL that contains several namespaces each containing multiple classes. The library has a "root" namespace, for lack of a better term. For example, MyVBLibrary. I have a static class (meaning it is not creatable) within a sub namespace. For example, MyVBLibrary.SubNamespace.MyStaticClass.

 

The problem I have is that I keep getting the little red exclamation point icon indicating that an instance of the object has not been created. And, none of the methods are listed when I select Call Method while editing the .Net Action step. 

 

However, if I take the static class out of the sub namespace so that it is MyVBLibrary.MyStaticClass, everything works fine. So, any ideas why? I think this is a bug in TestStand 4.2.1 (I don't know about other versions).

 

Any one have an explanation? 

 

I really do not want to take the static class out of the sub namespace.

 

Thanks.

0 Kudos
Message 1 of 5
(3,623 Views)

New bit of information: The sub namespace contains other non-static classes. If I move my static class to a new sub namespace by itself, it works fine. For example, MyVBLibrary.MySubNamespace2.MyStaticClass.

 

That's odd.

0 Kudos
Message 2 of 5
(3,619 Views)

I just can't figure this all out in one shot so I have another clarification.

 

Making the class non-static did not help. The issue seems to be with the name of the class and the name of the namespace. The first part of the name of the class matched the name of the sub namespace as in MyVBLibrary.MySubNamespace.MySubNameSpaceMyClass. When I change it to MyVBLibrary.MySubNamespace.MyClass it works fine. That still seems like a bug in TestStand. 

0 Kudos
Message 3 of 5
(3,613 Views)

Hello Skeptical,

 

I was wondering if you could post your assembly or the source code used, since it looks like you have already spent time developing an example, so I can try and recreate the issue on my end. Have a great day!

 

Best Regards,

 

Adam G

National Instruments
Applications Engineer
0 Kudos
Message 4 of 5
(3,572 Views)

Skeptical -

 

I have tried to reproduce this behavior in both C# and VB, but have not had any luck. Could you please provide a simple example project that displays this behavior and reproduces the issue? We would really like to get to the bottom of this and try to get it fixed.

Manooch H.
National Instruments
0 Kudos
Message 5 of 5
(3,542 Views)