Closed forderud closed 1 year ago
Hello forderud, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
pagoe-msft ⬆️ FYI
Hello forderud, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
@forderud we just added a capability to WebViewCompatible
to fallback if the process is elevated. I'm not sure if that'll also help in this scenario. Can you test out the build from our MyGet feed or we'll have a 6.1-preview out on NuGet soonish as well. Thanks!
@michael-hawker I've now tried both WebView
and WebViewCompatible
from the latest Microsoft.Toolkit.Forms.UI.Controls.WebView 6.1.0-preview1 on your MyGet feed. Unfortunately, both still fail with a E_ACCESSDENIED when being created from a low-integrity process.
Exception stack trace:
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
at Windows.Web.UI.Interop.WebViewControlProcessOptions..ctor()
at Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlProcessOptions.ToWinRtWebViewControlProcessOptions(WebViewControlProcessOptions options) in d:\a\1\s\WebView.Shared\Interop\WinRT\WebViewControlProcessOptions.cs:line 52
at Microsoft.Toolkit.Forms.UI.Controls.WebView.Initialize() in d:\a\1\s\Microsoft.Toolkit.Forms.UI.Controls.WebView\WebView.Init.cs:line 129
at Microsoft.Toolkit.Forms.UI.Controls.WebView.System.ComponentModel.ISupportInitialize.EndInit() in d:\a\1\s\Microsoft.Toolkit.Forms.UI.Controls.WebView\WebView.Init.cs:line 67
at Microsoft.Toolkit.Forms.UI.Controls.WebViewCompatible..ctor() in d:\a\1\s\Microsoft.Toolkit.Forms.UI.Controls.WebView\WebViewCompatible.cs:line 27
Gentle reminder.
@forderud the WebView components in this repo or no longer maintained see notice here. You should try WebView2
and see if it has the same issue; if so, please report a new issue on their repository.
I've already registered a corresponding issue on https://github.com/MicrosoftEdge/WebView2Feedback/issues/1969.
Thanks @forderud, I'll close this issue here then, as we don't plan to update any of the code here.
Describe the bug
I'm unable to add a Microsoft.Toolkit.Forms.UI.Controls.WebView control in my C# WinForms application if the process is running in low integrity mode. This makes me unable to display web content with a more modern browser than IE in a security sandboxed .Net application.
Steps to Reproduce
Steps to reproduce the behavior:
icacls <appname>.exe /setintegritylevel Low
" so that it will run in low integrity.System.UnauthorizedAccessException (E_ACCESSDENIED)
exception when callingEndInit()
if the process is running in low integrity.Process Explorer can be used to check if a process runs under the low, medium or high integrity.
Expected behavior
The WebView control should start normally, as for medium or high-integrity processes. The legacy
System.Windows.Forms.WebBrowser
also support low-integrity.Environment
Additional context
Stack trace from failure