C# 头孢锐铬。如何创建自定义项?
VS 2015 赢7x64 根据说明通过Nuget安装CefSharp。C# 头孢锐铬。如何创建自定义项?,c#,winforms,webbrowser-control,cefsharp,C#,Winforms,Webbrowser Control,Cefsharp,VS 2015 赢7x64 根据说明通过Nuget安装CefSharp。 已创建用户元素“CefSharp”。 在工具栏中,出现了我的“用户项”。 将“用户元素”拖到表单上。 一个错误 错误文本 * * 自定义项目代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; us
已创建用户元素“CefSharp”。
在工具栏中,出现了我的“用户项”。
将“用户元素”拖到表单上。
一个错误 错误文本
* * 自定义项目代码
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 ... '
我是否创建了错误的自定义项,或者这是一个尖锐的问题?删除对Cef.Initialize的调用。@amaitland我按照你说的做了。请参阅问题“解决方案1的尝试”使用设计器将ChromiumWebBrowser添加到控件中。添加代码并在另一个控件中使用设计器有点困难。似乎有一个已知的问题(),尽管“merceyz”对此有争议。我确实看到了一个用户控件的示例
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 ... '