Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinForms can't load local html file #2076

Closed
nickwei-wj opened this issue Jun 27, 2017 · 2 comments
Closed

WinForms can't load local html file #2076

nickwei-wj opened this issue Jun 27, 2017 · 2 comments

Comments

@nickwei-wj
Copy link

when I execute my app I get a white screen, the code like this

String page = string.Format(@"{0}\html-resources\html\index.html", Application.StartupPath);
chromeBrowser = new ChromiumWebBrowser(page);
this.Controls.Add(chromeBrowser); 
chromeBrowser.Dock = DockStyle.Fill;
BrowserSettings browserSettings = new BrowserSettings();
browserSettings.FileAccessFromFileUrls = CefState.Enabled;
browserSettings.UniversalAccessFromFileUrls = CefState.Enabled;
chromeBrowser.BrowserSettings = browserSettings;

when I change the local html file to url, it looks ok:
chromeBrowser = new ChromiumWebBrowser("www.github.com");

The cefSharp version is 57

@baby-Jie
Copy link

baby-Jie commented Jun 4, 2018

ensure set your index.html always copy to output

@aphkyle
Copy link

aphkyle commented Jul 30, 2021

ensure set your index.html always copy to output

Thanks it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants