0

VS 2015 win 7x64

Installed CefSharp via Nuget according to the instructions.
codeproject.com. Embedding Chrome in your C # App using CefSharp
Created the user element "CefSharp".
In the toolbar, my "user item" appeared.
Drag the "user element" onto the form.
An error.

Error Text
*

Could not create the 'CefSharpInitBrowser' component. Report on
error:
'System.IO.FileNotFoundException: Failed to load file or
assembly "CefSharp.Core, Version = 63.0.3.0, Сulture = neutral,
PublicKeyToken = 40c4b6fc221f4138 "or one of their dependencies.
The specified file can not be found.
Filename: 'CefSharp.Core, Version = 63.0.3.0, Сulture = neutral,
PublicKeyToken = 40c4b6fc221f4138 '
in rsh.Resources.CefSharpInitBrowser..ctorO
Warning: registration of assembly bindings is disabled.
To enable registration of assembly binding errors,
set the registry value
[HKLM \ Software \ Microsoft \ Fusion! EnableLog] (DWORD) at 1.
Note. Registration of assembly binding errors can
lead to a certain decrease in productivity.
To disable this feature, remove the registry value
[HKLM \ Software \ Microsoft \ Fusion! EnableLog].

*

Custom item code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

// 
using CefSharp;
using CefSharp.WinForms;

namespace rsh.Resources
{
    public partial class CefSharpInitBrowser : UserControl
    {
        public CefSharpInitBrowser()
        {
            InitializeComponent();

            Cef.Initialize(new CefSettings());
            ChromiumWebBrowser browser = new ChromiumWebBrowser("www.google.com");
            this.Controls.Add(browser);
            browser.Dock = DockStyle.Fill;
        }
      }
}

ATTEMPT OF SOLUTION 1
Commented in the code line

// Cef.Initialize (new CefSettings ());

Drag the "user element" onto the form.
An error.

Could not create the 'CefSharpInitBrowser' component. Report on
error:
'System.IO.FileNotFoundException: Failed to load file or
assembly "CefSharp.Core, Version = 63.0.3.0, Сulture = neutral,
PublicKeyToken = 40c4b6fc221f4138 "or one of their dependencies.
The specified file can not be found.
Filename: 'CefSharp.Core, Version = 63.0.3.0, Сulture = neutral,
PublicKeyToken = 40c4b6fc221f4138 '

at
CefSharp.WinForms.ChromiumWebBrowser.set_RequestContext (IReque
stContext value)

in CefSharp.WinForms.ChromiumWebBrowser..ctor (String address,
IRequestContext requestContext) in
c: \ projects \ cefsharp \ CefSharp.WinForms \ ChromiumWebBrowser.cs: page
Eye 365

in rsh.Resources.CefSharpInitBrowser..ctorO in
Z: \ vs \ csharp \ prb \ 42_prb \ nP \ 02_00 \ WinFormSUZ_00.00 \ rsh \ Resources \
CefSharpInitBrowser.cs: cTpoKa 24

Warning: registration of assembly bindings is disabled.
To enable registration of assembly binding errors,
set the registry value
[HKLM \ Software \ Microsoft \ Fusion! EnableLog] (DWORD) at 1.
Note. Registration of assembly binding errors can
lead to some reduction in the productive ... '

Am I creating a custom item incorrectly or is it a CefSharp problem?
image

  • Remove the call to Cef.Initialize. – amaitland May 12 '18 at 11:17
  • @amaitland I did as you said. See the question "ATTEMPT OF SOLUTION 1" – user9776818 May 16 '18 at 00:02
  • Add the ChromiumWebBrowser to your control using the designer. To add in code and use the designer in another control is a little difficult. – amaitland May 17 '18 at 09:44
  • There seems to be a known problem (https://github.com/cefsharp/CefSharp/issues/2206), though that's disputed by 'merceyz'. I do see an example of a User Control at https://github.com/cefsharp/CefSharp/blob/c37dbcd06a978ac000fdee14ac64df5b802eb2df/CefSharp.WinForms.Example/BrowserTabUserControl.cs – Stringfellow May 18 '18 at 00:56

0 Answers0