Replies: 4 comments 1 reply
-
I also tried installing from NuGet to see if there are any other dependencies that maybe aren't documented, but I get a "could not retrieve version info" error. |
Beta Was this translation helpful? Give feedback.
-
I've also tried cloning the minimal example, but when I try to add the winforms package I get the following error: Error while adding package 'CefSharp.WinForms' to project 'C:\Users<redacted>\CefSharp.MinimalExample-master\CefSharp.MinimalExample.WinForms\CefSharp.MinimalExample.WinForms.csproj'. The project does not support adding package references through the add package command. I tried again with NuGet, but I get the same error as before.... NuGet can't seem to get the version info and won't install it. Can someone please explain how on earth you get CefSharp up and running at all? I've been trying to do this for a few evenings now, and I'm at a loss. I'm starting to think it might be easier to write my own Chromium wrapper from scratch, at this rate. :( |
Beta Was this translation helpful? Give feedback.
-
As it turns out, you seemingly cannot get this to work unless you're using Visual Studio. If you happen to be someone who dropped VS previously and migrated to VSCode for your primary programming tool, stop here and redownload VS before you proceed further. No combination of redistributables, library inclusions or linker tools appears to work outside of Visual Studio to get CefSharp running in your program. You've been warned. On the other hand, if someone did actually get this working and compiled in VSCode, I'd love to see and learn from it. And upon further review, when using the NuGet package installer from Visual Studio, I DID get CefSharp.dll with the downloaded package! This seems to indicate that there is some problem with how the package is delivered if you access the following resources in VSCode:
|
Beta Was this translation helpful? Give feedback.
-
I started an issue relaying my findings here: |
Beta Was this translation helpful? Give feedback.
-
EDIT - SPOILER ALERT - I was using VSCode to try and do this. The issue ended up being some odd difference in how CefSharp is fetched, or the NuGet extension for it. In short: Don't try this with VSCode unless you already have all the required library files.
When including CefSharp.Winforms in a Windows Forms application, the built application encounters the following error on instantiating a ChromiumWebBrowser object:
An exception of type 'System.IO.FileNotFoundException' occurred in Story Writing.dll but was not handled in user code: 'Could not load file or assembly 'CefSharp, Version=104.4.180.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138'. The system cannot find the file specified.'
After searching the available files, CefSharp.dll does not appear to have come along with the package. Used to install:
dotnet add package CefSharp.WinForms --version 104.4.180
After reviewing the project asset configuration, I do not see any references to CefSharp.dll.
Target architecture is x64, and specified explicitly in the project.
Also installed CefSharp.Common and cef.redist.x64
DLLs for CefSharp.WinForms.dll, CefSharp.Core.Runtime.dll and other similar dll files are present in the build directory.
Beta Was this translation helpful? Give feedback.
All reactions