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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 4 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

debugger hangs on adsisearcher

Post by Lembasts »

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
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: debugger hangs on adsisearcher

Post by davidc »

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: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: debugger hangs on adsisearcher

Post by Lembasts »

The ldapfilter is '(samaccountname=test1)'.
I have run the debugger and there are no entries generated in the eventlog.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: debugger hangs on adsisearcher

Post by davidc »

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: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: debugger hangs on adsisearcher

Post by Lembasts »

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
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: debugger hangs on adsisearcher

Post by davidc »

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 3363 times

I recommend the following article as well:

https://info.sapien.com/index.php/guis/ ... sive-forms
David
SAPIEN Technologies, Inc.
This topic is 4 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.