MicrosoftEdge / WebView2Samples

Microsoft Edge WebView2 samples
830 stars 460 forks source link

Null Reference Exception when trying to run the WinForms sample project #215

Closed Astral100 closed 8 months ago

Astral100 commented 9 months ago

As the title says, I can't even run the WinForms_GettingStarted sample:

image

Tried on both Visual Studio 2019 and 2022. Both are run as administrator.

My OS is Windows 10.

I also tried installing latest WebView2 runtime, and it didn't help.

What is going on?

P.S. When I tried following tutorial to create project from scratch, I was able to follow this tutorial until step 5 (inclusive): https://learn.microsoft.com/en-us/microsoft-edge/webview2/get-started/winforms and it was working as expected (I was able to see microsoft website appearing as expected)

champnic commented 8 months ago

Hey @Astral100 - Which object is null in the failure? And when you follow the steps, it sounds like the WebView2 was running fine, but that something about adding the other controls in step 6 resulted in a crash?

Astral100 commented 8 months ago

Hello, after playing around with WebView2 for a few days I can't reproduce it anymore. The sample project runs fine now. I imagine it might have something to do with me installing and uninstalling webview2 runtime several times from my system after reporting the bug. It could be caused by old version of Edge runtime originally installed on my system. I am closing it down for now as it can't be reproduced

champnic commented 8 months ago

Thanks for confirming @Astral100, and glad you are no longer hitting this issue.