Product: PowerShell Studio 2024 (64 Bit)
Build: v5.8.238
OS: Windows 10.0.19045
PS Version(s): 5.1.19041.1, 7.3.4, 7.3.4
Hi,
I have several large existing PowerShell Studio Form projects that use (and rely on) the WebBrowser Control and I'm interested in "migrating" these over to the Edge-based WebView2 Control.
However, whenever I try experimenting with the WebView2 Control I get lots of seemingly inconsistent behaviors and errors in PS Studio.
For Example, If I create a new Form Project, add the WebView assemblies and link Microsoft.Web.WebView2.Core.dll & Microsoft.Web.WebView2.Winforms.dll, everything seems normal. I can add Controls (such as buttons) click them and get taken to the corresponding Event Handler etc... However, If I then add a WebView2 Control and click it (or add more Button Controls and click them) corresponding Event Handlers get created in the script but don't get "linked" to the Control. Multiple clicks on a control result in duplicate event handlers - but PowerShell Studio errors saying that there is no Event Handler .....
note: the userDataFolder is set at Form Load.
When a WebView2 project is saved and re-opened, I find that the paths to the linked assemblies are changed.
After much tinkering about, the most reliable approach I've found seems to be to link to Assemblies placed in the C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2024\Debugger64 folder. Even then, I still get an error when I first load the project.......However, If I close and re-open it - it's ok then until PowerShell Studio is restarted.
Quite often, when I start having issues with the WebView2 Control and linked assemblies fail to load and it fails to render the webPage the only solution is to restart the PC (closing and restarting PS Studio isn't enough).
Built projects with the assemblies seem to be fine.
I have found PowerShell Studio to be extremely reliable & robust - but when using Webview2 (and its assemblies) it suddenly all seems very flakey. Any ideas?
Thanks.
Build: v5.8.238
OS: Windows 10.0.19045
PS Version(s): 5.1.19041.1, 7.3.4, 7.3.4
Hi,
I have several large existing PowerShell Studio Form projects that use (and rely on) the WebBrowser Control and I'm interested in "migrating" these over to the Edge-based WebView2 Control.
However, whenever I try experimenting with the WebView2 Control I get lots of seemingly inconsistent behaviors and errors in PS Studio.
For Example, If I create a new Form Project, add the WebView assemblies and link Microsoft.Web.WebView2.Core.dll & Microsoft.Web.WebView2.Winforms.dll, everything seems normal. I can add Controls (such as buttons) click them and get taken to the corresponding Event Handler etc... However, If I then add a WebView2 Control and click it (or add more Button Controls and click them) corresponding Event Handlers get created in the script but don't get "linked" to the Control. Multiple clicks on a control result in duplicate event handlers - but PowerShell Studio errors saying that there is no Event Handler .....
note: the userDataFolder is set at Form Load.
When a WebView2 project is saved and re-opened, I find that the paths to the linked assemblies are changed.
After much tinkering about, the most reliable approach I've found seems to be to link to Assemblies placed in the C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2024\Debugger64 folder. Even then, I still get an error when I first load the project.......
Code:
Unhandled exception: An item with the same key has already been added.
Quite often, when I start having issues with the WebView2 Control and linked assemblies fail to load and it fails to render the webPage the only solution is to restart the PC (closing and restarting PS Studio isn't enough).
Built projects with the assemblies seem to be fine.
I have found PowerShell Studio to be extremely reliable & robust - but when using Webview2 (and its assemblies) it suddenly all seems very flakey. Any ideas?
Thanks.
Statistics: Posted by mark106 — Mon Mar 04, 2024 8:35 am — Replies 2 — Views 190