NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a TestStand bug that causes a .NET FolderBrowseDialog problem?

Solved!
Go to solution

When calling a sequence that calls into a .NET library, when the FolderBrowseDialog is displayed, the folder selection tree control is not displayed.  When this is called from a .NET executable everything works fine.  See attached.  I am using C# 2008 and TestStand 4.2.

 

From .NET                                                      From TestStand

DotNet file browse.JPGteststand file browse.JPG

0 Kudos
Message 1 of 3
(3,521 Views)
Solution
Accepted by topic author skribling

This might be an issue with the kind of thread that is displaying the dialog. Generally .NET UI code should be run from a STA (Single-Threaded Apartment) thread. You might have noticed the [STAThread] attribute on your main entry point in C# which does this for you in your .NET executable.

 

You can create an STA thread in TestStand by using the sequence call step. Select the "Use New Thread" Execution Option and check the "Use Single-Threaded Apartment" checkbox in the advanced settings dialog.

0 Kudos
Message 2 of 3
(3,496 Views)
The advanced setting "Use Single-Threaded Apartment" was the key.  Works fine now.
0 Kudos
Message 3 of 3
(3,486 Views)