【问题标题】:WinForm CefSharpWinForm CefSharp
【发布时间】:2019-01-09 16:28:21
【问题描述】:

我只是尝试在一个新的winForm 应用程序上安装CefSharp,我使用 Nuget 安装了最新版本并完成了本文的所有步骤: https://ourcodeworld.com/articles/read/173/how-to-use-cefsharp-chromium-embedded-framework-csharp-in-a-winforms-application

Running on : "Any CPU"
Visual Studio 2013
CefSharp 69.0.0

当我运行应用程序时出现此错误:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
Additional information: Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies. The specified module could not be found.

这是代码:

var settings = new CefSettings();
Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null);

知道是什么问题吗?

编辑 这是我项目的 app.config 文件:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <probing privatePath="x86"/>
        </assemblyBinding>
    </runtime>
</configuration>

【问题讨论】:

  • 该文件是否存在于您正在运行的进程(和/或构建输出)的启动目录中?我遇到了一些 NuGet 问题,其中 CefSharp 文件在编译后被删除。
  • @WaiHaLee 启动目录在哪里?因为我只是尝试从 VS2013 运行它
  • 它将是包含项目可执行文件的文件夹,例如(myproject.)\bin\debug - (myproject) 是 .csproj 文件所在的位置。
  • @amaitland 我尝试了帖子中的所有信息并不断收到此错误。示例项目正常工作,但它适用于 63.0 而不是 69.0。,我还注意到只有 CefSharp.Core.dll 未加载但 CefSharp.WinForms.dll 加载完美

标签: c# winforms cefsharp chromium-embedded


【解决方案1】:

在我们的案例中,这发生在我们未能安装 Visual C++ 运行时。

【讨论】:

    【解决方案2】:

    在 app.config 文件中,请检查 CelfSharp 的dependentAssembly 段。 如果有任何条目,请确保添加的引用版本在有效范围内。

    【讨论】:

    • 我只是用 app.config 文件内容更新了我的问题,我看不到有关 CefSharp 的任何信息
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-23
    • 1970-01-01
    • 1970-01-01
    • 2015-02-23
    • 2022-12-08
    相关资源
    最近更新 更多