Open anilgenius opened 4 years ago
same error, System.NullReferenceException: 'Object reference not set to an instance of an object.' Building on Visual Studio 2019
StackTrace at Microsoft.Web.WebView2.WinForms.WebView2.OnVisibleChanged(EventArgs e) at System.Windows.Forms.Control.AssignParent(Control value) at System.Windows.Forms.Control.ControlCollection.Add(Control value) at System.Windows.Forms.Form.ControlCollection.Add(Control value) at WebView2WindowsFormsBrowser.BrowserForm.InitializeComponent() in ...\WebView2Samples\WebView2WindowsFormsBrowser\BrowserForm.Designer.cs:line 215
Thanks for trying out the sample apps! Can you expand a bit on what you were trying to do when you experienced this error? Is there a specific action within the app that led to this, or was it on launch?
Application could not launch, it throw System.NullReferenceException on Form InitializeComponent .
After installation Microsoft Edge BETA Version 84.0.522.26
on computer, fixed and working now.
Thanks.
Using "Version 84.0.522.40 (Official build)" the problem is still present.
@LukeOwlclaw Can you tell me what channel that Edge build is? What version of the SDK are you using? Could you add some repro steps that led to that error for you?
@MinChanSike Glad the issue resolved for you!
@champnic I just installed Edge and did not change the channel. Then I created a WinForms C# project (.NET Framework 4.7.2), installed WebView2 NuGet version 0.9.515-prerelease (because that is the latest version which supports my Edge version), dropped a WebView2
component on the form, and hit run ==>
@LukeOwlclaw Are you using the stable channel of Edge? If so you need to use a Canary or Dev build of Edge. Or you can use the WebView2 Runtime.
I just tried your steps locally (Using 0.9.515-prerelease, VS 2019 16.6.2, WV2RT 85.0.564.8) and created a WinForms app, dropped the control, and it worked fine.
Yes, I am using the stable channel. It is currently at 84.0.522. The release notes for the WebView2 version I am using (0.9.515-prerelease), states:
minimum Microsoft Edge version 84.0.515.0.
So it should work, shouldn't it?
Unfortunately we don't support the stable channel, only the Canary/Dev/Beta and the Runtime. @liminzhu has more details here: https://github.com/MicrosoftEdge/WebViewFeedback/issues/341#issuecomment-662719106
@champnic Thanks for the link. Though I do not understand why the distribution channel matters if the release version is exactly the same. But I guess it'll come all together once it is released...
I have the same problem version 0.9.628 Dev channel
@erpcto Is your issue with the sample app or your own app?
@erpcto Is your issue with the sample app or your own app?
This exception is prompted when my new program references the control and runs.
What version of Edge/Runtime are you using? It's possible you're hitting https://github.com/MicrosoftEdge/WebView2Feedback/issues/535.
I use the Dev channel
What version of Edge/Runtime are you using? It's possible you're hitting MicrosoftEdge/WebView2Feedback#535. I use the Dev channel
in the winform sample system.nullreferenceexception came on
line this.Controls.Add(this.webView2Control);