Windows 窗体
一组用于开发图形用户界面的 .NET Framework 托管库。
142 个问题
你好;
我在“第 3 步 - 创建单个 WebView”
https://learn.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/winforms
但是当我编译程序时,我收到以下错误;
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Microsoft.Web.WebView2.WinForms
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 WinFormsGettngStarted.Form1.InitializeComponent() in C:\Users\vmars\source\repos\WinFormsGettngStarted\Form1.Designer.cs:line 50
From this line: this.Controls.Add(this.webView);
我怎样才能克服这个错误?
Note:此问题总结整理于: WebView2 WinForms c# "3. Getting Started" Errors ?
感谢您抽出宝贵时间在 Microsoft Q&A 论坛中发布此问题。
此问题是由于没有选择合适的,请转到Winform项目的属性页面(右键单击>属性),然后单击>并选择,然后再次按下以测试。Platform targetBuildPlatform targetx64F5
如果答案有帮助,请点击“接受答案”并点赞。 注意:如果您想接收此线程的相关电子邮件通知,请按照我们文档中的步骤启用电子邮件通知。