Is there an existing issue for this?
CefSharp Version
124.3.80
Operating System
Windows 10
Architecture
x64
.Net Version
7.0
Implementation
WinForms
Reproduction Steps

using CefSharp;
using CefSharp.WinForms;
namespace cefsharp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitializeChromium();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Cef.Shutdown();
base.OnFormClosing(e);
}
private void InitializeChromium()
{
chromiumWebBrowser1 = new ChromiumWebBrowser("about:blank")
{
Dock = DockStyle.Fill
};
this.Controls.Add(chromiumWebBrowser1);
chromiumWebBrowser1.LoadingStateChanged += chromiumWebBrowser1_LoadingStateChanged;
}
private void chromiumWebBrowser1_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
{
if (!e.IsLoading)
{
// Once the page has finished loading, execute JavaScript to display "Hello, World!" in the browser
chromiumWebBrowser1.ExecuteScriptAsync("document.body.innerHTML = '<h1>Hello, World!</h1>';");
}
}
}
}
using CefSharp.WinForms;
using System.Runtime.ConstrainedExecution;
using CefSharp;
using CefSharp.WinForms;
namespace cefsharp
{
internal static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
// Set up CefSharp settings
CefSettings settings = new CefSettings();
// Initialize CefSharp with the provided settings
Cef.Initialize(settings);
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}
}
Expected behavior
I wanted a working web browser. CefSharp just does not work in Visual Studio anymore.
Actual behavior
Does not run or compile.
Regression?
I tried on version 7.0 and version 8.0
Known Workarounds
None found
Does this problem also occur in the CEF Sample Application
Yes using WPF/OffScreen command line args
Other information
using CefSharp;
using CefSharp.WinForms;
namespace cefsharp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitializeChromium();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Cef.Shutdown();
base.OnFormClosing(e);
}
private void InitializeChromium()
{
chromiumWebBrowser1 = new ChromiumWebBrowser("about:blank")
{
Dock = DockStyle.Fill
};
this.Controls.Add(chromiumWebBrowser1);
chromiumWebBrowser1.LoadingStateChanged += chromiumWebBrowser1_LoadingStateChanged;
}
private void chromiumWebBrowser1_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
{
if (!e.IsLoading)
{
// Once the page has finished loading, execute JavaScript to display "Hello, World!" in the browser
chromiumWebBrowser1.ExecuteScriptAsync("document.body.innerHTML = '<h1>Hello, World!</h1>';");
}
}
}
}
Is there an existing issue for this?
CefSharp Version
124.3.80
Operating System
Windows 10
Architecture
x64
.Net Version
7.0
Implementation
WinForms
Reproduction Steps
using CefSharp;
using CefSharp.WinForms;
namespace cefsharp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitializeChromium();
}
}
using CefSharp.WinForms;
using System.Runtime.ConstrainedExecution;
using CefSharp;
using CefSharp.WinForms;
namespace cefsharp
{
internal static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
// Set up CefSharp settings
CefSettings settings = new CefSettings();
// Initialize CefSharp with the provided settings
Cef.Initialize(settings);
}
Expected behavior
I wanted a working web browser. CefSharp just does not work in Visual Studio anymore.
Actual behavior
Does not run or compile.
Regression?
I tried on version 7.0 and version 8.0
Known Workarounds
None found
Does this problem also occur in the CEF Sample Application
Yes using WPF/OffScreen command line args
Other information
using CefSharp;
using CefSharp.WinForms;
namespace cefsharp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitializeChromium();
}
}