Form not visible when started from runas compiled script

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
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.
This topic is 5 years and 1 day 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
amplexus
Posts: 2
Last visit: Wed Mar 27, 2019 6:34 am

Form not visible when started from runas compiled script

Post by amplexus »

Hello,

I have a form that both needs runas credentials as elevation before running.
therefore I found and followed this article : https://www.sapien.com/blog/2017/01/19/ ... nistrator/
Now the issue is as follows: when I open PowerShell with runas and start the elevated exe all is normal and the form is displaying properly. (pic normal)
When I compile it in PowerShell studio the form starts but the form(layout) isn't visible. just a window with a 'print screen' of whatever is open at that moment. (pic elevated)... the 2 black stripes in the image are always present on the same place)
However it seems the controls are there (clicking the righthand top corner closes the exe).
I already with a pause in the beginning of the starter.exe and do a $form.refresh in the $form_Load without success.
All tips are welcome.
Bob
Attachments
Normal.PNG
Normal.PNG (6.73 KiB) Viewed 15049 times
Eleveted.PNG
Eleveted.PNG (51.61 KiB) Viewed 15049 times
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Form not visible when started from runas compiled script

Post by davidc »

I believe this is a .NET bug which involves Run As and Elevation. Refer to the following post:

viewtopic.php?f=12&t=12728
David
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Form not visible when started from runas compiled script

Post by Alexander Riedel »

This forum section is reserved for customer service requests. For product issues please post in the corresponding product forum or in the trial support forum as needed.
In either case make sure you provide the requested version and OS information.
[Topic moved by moderator]
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
amplexus
Posts: 2
Last visit: Wed Mar 27, 2019 6:34 am

Re: Form not visible when started from runas compiled script

Post by amplexus »

Many Thanks for the feedback davidc !
This topic is 5 years and 1 day 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.