After installing the following NuGet packages:
- cef.redist.x64
- CefSharp.Common
- CefSharp.Wpf
And following the following video tutorial: How to make a Cefsharp Web Browser in WPF C#, adding an app manifest file and uncommenting the Windows 10 key.
Then, referencing the CefSharp
component in the Xaml window header: xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
.
Following these steps, the tag <cef:ChromiumWebBrowser Address="https://google.ca" Height="400" Width="400"/>
should construct the browser element. Instead, the following error appears, signaling that Xaml line:
Unknown build error, 'Could not find assembly 'CefSharp, Version=107.1.90.0 ...' Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.
Visual Studio suggests adding a reference to the CefSharp
library, but clicking on this suggestion always fails for whatever reason.
By consulting the documentation, one can find a minimal running example. Yet, the quickstart example didn't even work for me (build errors and such).
By consulting answers on StackOverflow, it would appear that the correct Visual C++ Redistributable installation is required, and that not having this installed could cause referencing issues. This did not solve the problem for me.
I also tried changing build values, build configurations, uncommenting certain lines in the configuration file, and consulted documentation and other questions on StackOverflow. None of them mentioned having the exact error.