【发布时间】:2015-11-25 14:07:29
【问题描述】:
我在我的项目中使用 CefSharp WinForms,我无法让它从 CefSharp 浏览器控件执行 JS 脚本 (虽然我是导航到 URL - 所以大多数 CEF 功能都有效) 我尝试按照以下教程进行操作:https://github.com/cefsharp/CefSharp/search?utf8=%E2%9C%93&q=BoundObject
我正在使用以下命名空间:
using CefSharp.WinForms;
using CefSharp.Internals;
并添加了对以下程序集 (x64) 的引用:
CefSharp.WinForms.dll
CefSharp.dll
CefSharp.Core.dll
但是当我尝试使用其中一个功能时,我仍然收到以下错误: ExecuteScriptAsync 或 EvaluateScriptAsync
我收到以下错误:
'CefSharp.WinForms.ChromiumWebBrowser' does not contain a definition for 'EvaluateScriptAsync' and no extension method 'EvaluateScriptAsync' accepting a first argument of type 'CefSharp.WinForms.ChromiumWebBrowser' could be found (are you missing a using directive or an assembly reference?)
'CefSharp.WinForms.ChromiumWebBrowser' does not contain a definition for 'ExecuteScriptAsync' and no extension method 'ExecuteScriptAsync' accepting a first argument of type 'CefSharp.WinForms.ChromiumWebBrowser' could be found (are you missing a using directive or an assembly reference?)
谁能指导我到我想念的地方?还有其他 API 吗?也许我缺少一些参考 dll? 谢谢
【问题讨论】:
-
您是否安装了
Nuget软件包?您具体使用的是哪个版本?在较新的版本中,这些方法被制成Extension Methods,因为它们可以在特定帧上执行。在几个案例中,我看到人们遇到了麻烦。尝试先获取主机。示例见github.com/cefsharp/CefSharp/blob/cefsharp/45/CefSharp/…