Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

WebView hangs in EndInit() when run as administrator #50

Open
robertdeml opened this issue Oct 24, 2018 · 7 comments
Open

WebView hangs in EndInit() when run as administrator #50

robertdeml opened this issue Oct 24, 2018 · 7 comments
Labels
bug 🐛 Something isn't working WebView 🖥️ WPF and WinForms WebView

Comments

@robertdeml
Copy link

I'm submitting a...

Bug report (I searched for similar issues and did not find one)

Current behavior

Start Visual Studio as administrator.
Create a new WinForms application.
Add a WebView control to the form.
Run the application.
The form does not appear. When you click "Break All " to pause debugging, the current debugging location is inside "((System.ComponentModel.ISupportInitialize)(this.webView1)).EndInit();" in InitializeComponents().

Expected behavior

The WinForm should open the web page normally.

Minimal reproduction of the problem with instructions

Run the application.

Environment

Nuget Package(s):
Microsoft.Toolkit.Win32.UI.Controls 4.0.2

Windows 10 Build Number:
April 2018 Update (17134)

App min and target version:
I'm not sure where to find this.

Device form factor:
Desktop

Visual Studio
2017 (version: 15.7.6)

@PoulBak
Copy link

PoulBak commented Oct 30, 2018

I can confirm this behaviour (I run VS as admin to debug local IIS websites). Running VS as ordinary user makes it Work. I have tried this with different applications, the only requirement to reproduce is to run as admin.
It took a lot of time to figure this out. If you can't fix the bug, please throw an error in 'BeginInit', telling the user: "WebView can't run as admin!"

@keiserS
Copy link

keiserS commented Dec 16, 2018

This also happens when you use new version of Toolkit v.5.
Telling user he can't run as admin is not acceptable imho!

Exception being raised in InitializeComponent method is:
**The remote procedure call failed. (Exception from HRESULT: 0x800706BE)**

Can someone get insight how to overcome this? and what is the real reason.. here is stack trace:

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlProcess.<CreateWebViewControlHostAsync>d__16.MoveNext() in D:\a\1\s\WebView.Shared\Interop\WinRT\WebViewControlProcess.cs:line 95
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Toolkit.Forms.UI.Controls.WebViewControlProcessExtensions.CreateWebViewControlHost(WebViewControlProcess process, IntPtr hostWindowHandle, Rectangle bounds) in D:\a\1\s\Microsoft.Toolkit.Forms.UI.Controls.WebView\WebViewControlProcessExtensions.cs:line 178
   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

@NikasZalias
Copy link

Yes with v5 the problem is still there... Could someone please explain how to overcome this?

@azchohfi azchohfi transferred this issue from CommunityToolkit/WindowsCommunityToolkit Jan 15, 2019
@azchohfi azchohfi added the WebView 🖥️ WPF and WinForms WebView label Jan 15, 2019
@Kyaa-dost Kyaa-dost added the bug 🐛 Something isn't working label Sep 24, 2019
@the-dag
Copy link

the-dag commented Dec 17, 2019

I'm using 6.0, and am a bit flabbergasted to see such a blocking bug, that is so easy to reproduce, continues to be present in multiple major versions. Why isn't this getting fixed?

I want to use the control in an application that must run as administrator. This is clearly a bug, and in my case makes the control completely useless.

@Que8549
Copy link

Que8549 commented Jan 24, 2020

Any updates on this? This is still an issue in Microsoft.Toolkit.Forms.UI.Controls.WebView v6.0

@gjvdkamp
Copy link

gjvdkamp commented Apr 7, 2020

THANK YOU!

I had the same issue, have been pulling my hair out for 2 days now.
I can confirm thisis still an issue, workauround for me is to not run in admin mode (which I would never have figured was the cause).

@protegesolutions
Copy link

Arrggghhh. This is a real gotcha; I use this control in a class library for oAuth2 authorisation. But the consuming app requires VS to be run as Admin. Even consuming the library as Release means that the end app receives this error. So effectively the control is useless in any app that requires Admin rights. What a joke. (Yes, I know about WebView2 but it is VERY heavy for a class library when it's only used in a very minor sense.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 Something isn't working WebView 🖥️ WPF and WinForms WebView
Projects
None yet
Development

No branches or pull requests

10 participants