CefSharp Chromium。如何创建自定义项?

时间:2018-05-12 09:50:00

标签: c# winforms webbrowser-control cefsharp

VS 2015 赢7x64

按照说明通过Nuget安装CefSharp codeproject.com. Embedding Chrome in your C # App using CefSharp
创建了用户元素“CefSharp” 在工具栏中,出现了“用户项” 将“用户元素”拖到表单上 错误。

错误文字
*

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].

*

自定义商品代码

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;
        }
      }
}

尝试解决方案1 ​​
  在代码行中评论

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

将“用户元素”拖到表单上 一个错误。

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 ... '

我是否错误地创建了自定义项目,还是CefSharp问题? image

0 个答案:

没有答案