C
C#11mo ago
Cience

❔ Webview2 showing nothing just blank

i installed Webview2 using the nuget package like 3 weeks ago it was working fine for my program and i took a break and now i come back and it doesnt load anything i made a test form and it does the same thing (example show of whats happening), i've provided my designer.cs, and test.cs files so someone can help me figure out whats happening
2 Replies
Cience
Cience11mo ago
Designer.cs
webView21 = new Microsoft.Web.WebView2.WinForms.WebView2();
((System.ComponentModel.ISupportInitialize)webView21).BeginInit();
SuspendLayout();
//
// webView21
//
webView21.AllowExternalDrop = true;
webView21.BackColor = SystemColors.Control;
webView21.CreationProperties = null;
webView21.DefaultBackgroundColor = Color.White;
webView21.Location = new Point(12, 12);
webView21.Name = "webView21";
webView21.Size = new Size(776, 426);
webView21.Source = new Uri("https://google.com", UriKind.Absolute);
webView21.TabIndex = 0;
webView21.ZoomFactor = 1D;
//
// test
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(webView21);
Name = "test";
Text = "test";
Load += test_Load;
((System.ComponentModel.ISupportInitialize)webView21).EndInit();
ResumeLayout(false);
webView21 = new Microsoft.Web.WebView2.WinForms.WebView2();
((System.ComponentModel.ISupportInitialize)webView21).BeginInit();
SuspendLayout();
//
// webView21
//
webView21.AllowExternalDrop = true;
webView21.BackColor = SystemColors.Control;
webView21.CreationProperties = null;
webView21.DefaultBackgroundColor = Color.White;
webView21.Location = new Point(12, 12);
webView21.Name = "webView21";
webView21.Size = new Size(776, 426);
webView21.Source = new Uri("https://google.com", UriKind.Absolute);
webView21.TabIndex = 0;
webView21.ZoomFactor = 1D;
//
// test
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(webView21);
Name = "test";
Text = "test";
Load += test_Load;
((System.ComponentModel.ISupportInitialize)webView21).EndInit();
ResumeLayout(false);
and test.cs
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace test
{
public partial class test : Form
{
public test()
{
InitializeComponent();
}

private void test_Load(object sender, EventArgs e)
{
webView21.Source = new Uri(string.Format("https://google.com", Directory.GetCurrentDirectory()));

}
}
}
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace test
{
public partial class test : Form
{
public test()
{
InitializeComponent();
}

private void test_Load(object sender, EventArgs e)
{
webView21.Source = new Uri(string.Format("https://google.com", Directory.GetCurrentDirectory()));

}
}
}
ping me if you respond
Accord
Accord11mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.