-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlazorWebView - grey screen on one machine #8461
Comments
@sgacond thanks for contacting us. I'm not sure how we could troubleshoot this. But I would start by using windbg to break on all thrown exceptions and see if there is a concrete exception that might be causing this. You might also want to report this to the webview2 repo to see if they can offer you other tips to troubleshoot this. |
Hi @javiercn I ran the app using windbg and there are some exceptions in the command window. But windbg didn't break (tried "run until unhandled" and "run until handled"). Unfortunately, i'm not really used to this, sorry... One is in Line 316+ after loading the WebView2 Loader:
There are also unregistered COM classes (Line 411+):
I also captured a memory dump of the process. Download Memory Dump |
@sgacond could you inspect the exception when it happens? You should be able to get the exception name as well as the details. |
@javiercn I'm very sorry... I just fought against the preview and the "classic" version of windbg and was only able to get this: |
@sgacond I had success in the past with https://www.sysadmins.lv/retired-msft-blogs/alejacma/managed-debugging-with-windbg-breaking-on-an-exception-part-1.aspx |
If you dump the |
@sgacond that's weird, what happens if you try to do !DumpObject |
The other thing that you can try is, once you are in that state, search for all the exceptions in the heap |
--- deleted Ok... it was the wrong one. Sorry! Please disregard. |
This should be right break point now:
Exception Object dump:
Print Exception
... omitted rest - the stack trace is huuuuuge... see attached text file. |
@sgacond do you see anything if you inspect 00205E5FB74283E8 011E5E5FB7428BE9 System_Private_CoreLib!System.BadImageFormatException..ctor(System.String, Int32)+0xb7428bea Check that the bitness of the executable and the OS matches, or that the .NET installation in the machine is solid. You can try publish the app as self-contained too |
@javiercn First of all, thanks again for your patience. I think I'm fishing in the dark and I was really unsure if I was inspecting the right exceptions. So I tried to remove unnecessary things (squirrel update worker, logger, ...) that could lead to other exceptions. After this, I did another clean self contained build (was self contained already) in debug mode. Now, windbg doesn't break anymore. Even with But, the behavior stayed. So I breaked and looked at all the exceptions on the heap:
I think this is a textual search, therefore only the "real" exception are: I tried to dump all three, but all with null pointers for _message or _stackTraceString: ExecutionEngineException:
StackOverflowException:
OutOfMemoryException
I repeated the same step on my machine, where the exact same self-contained build runs just fine.
The Exceptions are here too. Therefore I think, the faulty behavior isn't visible in this Exception objects. |
One more thing: I just recreated the most simple HelloWorld sample (according to this doc) and the issue persists. Also the windbg behavior is the same. No break. Same three Exceptions on the heap:
|
@sgacond thanks for the additional details. You can discard stackoverflow and outofmemory exceptions. The runtime always allocates those two ahead of time, since it can’t allocate if it has no memory. I’m not sure about ExecutionEngineException, but it’s likely to be the case. Could you create an app with just the webview (No blazor) and check if the issue still happens? |
It may help to catch the unhandled exceptions and perhaps you will get a hint from the error parameter Add this to your main AppDomain.CurrentDomain.UnhandledException += (sender, error) => |
Thanks for your hints! The basic blazor one from above, but extended with a global unhandled exception handler (message box). A basic WebView2 Hello World: public Form1()
{
var webView = new WebView2()
{
Dock = DockStyle.Fill,
Padding = new Padding(0, 1, 0, 0),
Source = new("https://mod-dotnet-bot.net/")
};
InitializeComponent();
Controls.Add(webView);
} ==> Same here - works on my machine just fine, but on the target machine only system-grey. No exceptions. |
Is there an existing issue for this?
Describe the bug
Hi! I hope i'm on the right repo here, because I'm not sure if the error is caused in WebView2 or in the BlazorWebView control. Feel free to close and point me to the right repo if needed. Thanks in advance!
We use BlazorWebView hosted using the Win Forms Control (
Microsoft.AspNetCore.Components.WebView.WindowsForms
) and have issues on one particular machine.The app starts and doesn't load the WebView control (stays "system grey"). The application itself runs fine and (according to our logs) seems to work normally. Just the UI doesn't show up. DevTools aren't available either.
We already tried to reinstall the WebView2 runtime (Evergreen installer). Unfortunately no success.
Expected Behavior
BlazorWebView showing UI like on other machines.
Steps To Reproduce
Unfortunately it's not reproducable on other machines. Therefore I don't have a repro.
HostForm.cs constructor:
Exceptions (if any)
Unfortunately no exception.
.NET Version
6.0.300 (self contained build fails on target machine - win-x64)
Anything else?
The issue persists on only this particular machine.
Machine information (sorry, german localization):
Is it possible to gather more information about this behaviour? I'm struggling finding logs or more information.
The text was updated successfully, but these errors were encountered: