Replies: 1 comment 4 replies
-
Converting to discussion as it's not clear this is actually a bug.
Are you trying to create the OffScreen ChromiumWebBrowser instance inside the IIS process? You say using in a WinForms project though it's unclear how WinForms fits exactly. Because of CEF's strict requirements for Cef.Initialize/Cef.Shutdown running CefSharp within the same process as IIS is not recommend. You'd be better off using https://github.com/hardkoded/puppeteer-sharp |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What version of the product are you using?
What architecture x86 or x64?
x64 / AnyCPU
What version of .Net?
.Net 4.8
On what operating system?
Win10
Are you using
WinForms
,WPF
orOffScreen
?OffScreen
What steps will reproduce the problem?
I'm trying to use CefSharp from inside a WebForms site (it should call itself to print a page to PDF).
I've created a minimal website that reproduces the problem: https://gist.github.com/cosmo0/e245a3f5dae8e18b0e49e5b5fe63047e ; I've created an IIS website targeting this site, I am not using IIS Express. I have a bunch of other, complex ASP.Net sites on this IIS installation, so it works (maybe CefSharp needs a special configuration, though).
Please note that by default, a WebForms site builds into
/bin
, not/bin/Debug/x64
or whatever. This is a problem, as the.build
,.props
and.targets
files in the Nuget package all hard-wire/x86
and/x64
paths.Using
AnyCPU
build target, theDefault.aspx
page loads, but when I click on "export", I get an error:This is expected: as I mentioned, CefSharp copies the files in the wrong directory, and the
CefSharp.Core.Runtime
file is indeed missing. So I open the/bin/x64
folder, and copy/paste all the files into/bin
.Now when I load the
Default.aspx
page, I immediately get a similar but slightly different error:Cleaning the
bin
folder and using thex64
build target, the CefSharp files are copied in the right folder, directly into/bin
(?), and I get the second error immediately while loading the page.I have tried all the steps mentioned in https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#Runtime_dependencies ; nothing works.
I have built a minimal command-line application, it works perfectly, so it's not a problem on my machine configuration.
Beta Was this translation helpful? Give feedback.
All reactions