debugger hangs on adsisearcher

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Lembasts
Posts: 217
Joined: Thu Mar 15, 2012 9:47 am

debugger hangs on adsisearcher

Post by Lembasts » Sun May 26, 2019 6:25 pm

Product, version and build: PS build 163
32 or 64 bit version of product: 64 bit
Operating system: windows 10 1709
32 or 64 bit OS: 64

I have a single form with this line of code:
$search = [adsisearcher]$ldapfilter

If I put a breakpoint on that line, run the debugger and press F11 to execute that line, PS Studio hangs.
If I just run it, the command fails without any error message (the variable $search is $null).
However, If I select that line and say 'Run selection in console' it works fine.
The script engine is PS V5 host (windows forms). Under options, assemblies, there is a thing called system.directoryservices, version=4.0.0.0
Any ideas?
Thanks
David

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: debugger hangs on adsisearcher

Post by davidc » Tue May 28, 2019 7:19 am

When at a breakpoint, the debugger tries to take a snapshot of the object's contents. It could be that a property in the contents of the $Idapfilter is causing the crash.

Please check the Event Logs and see if there are any entries for ScriptDriverXX.exe (where XX could be 32 or 64).
David
SAPIEN Technologies, Inc.

User avatar
Lembasts
Posts: 217
Joined: Thu Mar 15, 2012 9:47 am

Re: debugger hangs on adsisearcher

Post by Lembasts » Tue May 28, 2019 2:16 pm

The ldapfilter is '(samaccountname=test1)'.
I have run the debugger and there are no entries generated in the eventlog.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: debugger hangs on adsisearcher

Post by davidc » Thu May 30, 2019 11:30 am

Unfortunately, AD is outside of my expertise, but it could be that fact that you are running the command within the form itself. Some commands can hang because the form is holding up the pipeline. Try running the command before displaying the form or using a job (JobTracker control set).
David
SAPIEN Technologies, Inc.

User avatar
Lembasts
Posts: 217
Joined: Thu Mar 15, 2012 9:47 am

Re: debugger hangs on adsisearcher

Post by Lembasts » Thu May 30, 2019 2:28 pm

Thanks.
How do you run a command before displaying the form?
The command in question is actually in the load event.
I have never heard of the jobtracker control set...

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: debugger hangs on adsisearcher

Post by davidc » Thu May 30, 2019 2:48 pm

You can run the code at the top of the script outside of the load event. That will run before the form is show.

As for the job tracker, I recommend using the Button - Start Job control set as a starting point:
Button - Start Job Control Set.png
Button - Start Job Control Set.png (26.48 KiB) Viewed 1505 times

I recommend the following article as well:

https://info.sapien.com/index.php/guis/ ... sive-forms
David
SAPIEN Technologies, Inc.