“無法加載文件或程序集 CefSharp.Core.dll ”或它的一個依賴。


本地調試、安裝正常運行,拷貝到其他計算機運行異常,原因可能如下:

  1. VC++ 2012/2013 可重新分發包*是為了在非開發者機器上運行CefSharp所必需的, 您可以將所需的dll作為應用程序的一部分。
  2. 執行文件夾中不存在所有依賴關系。 CefSharp 包括 非托管 的dll和資源,這些文件通過安裝 Nuget 包時包含在項目中的兩個 .props 文件復制到執行文件夾。 請參閱下面所需的文件列表,確保所需的文件存在。
  3. 你通過安裝程序打包應用程序進行發布,並且不會在目標計算機上運行。 默認情況下,安裝程序不包括 非托管 資源,您需要手動添加它們。 

注: 如果在 XAML 中初始化 WPF 控件時遇到 FileNotFoundException ,這也適用。

注2:如果從源代碼編譯(不推薦使用 Nuget 包),並注意到您不能再以debug模式構建,但是release構建工作正常,您可能需要修復Visual Studio版本。 這種情況發生在少數情況下,您將獲得如上所示,丟失的非托管.dll文件相同的提示信息。

 

Visual C++需要安裝哪個版本取決了你引用的CefSharp的版本:

* For .Net Core Packages VC++ 2019 is required
** For .Net Core Packages .Net Core 3.1/.Net 5.0 is required.

Branch CEF Version VC++ Version .Net Version Status
master 4515 2015* 4.5.2** Development
cefsharp/91 4472 2015* 4.5.2** Release
cefsharp/90 4430 2015* 4.5.2** Unsupported
cefsharp/89 4389 2015* 4.5.2** Unsupported
cefsharp/88 4324 2015* 4.5.2** Unsupported
cefsharp/87 4280 2015* 4.5.2** Unsupported
cefsharp/86 4240 2015 4.5.2 Unsupported
cefsharp/85 4183 2015 4.5.2 Unsupported
cefsharp/84 4147 2015 4.5.2 Unsupported
cefsharp/83 4103 2015 4.5.2 Unsupported
cefsharp/81 4044 2015 4.5.2 Unsupported
cefsharp/79 3945 2015 4.5.2 Unsupported
cefsharp/77 3865 2015 4.5.2 Unsupported
cefsharp/75 3770 2015 4.5.2 Unsupported
cefsharp/73 3683 2015 4.5.2 Unsupported
cefsharp/71 3578 2015 4.5.2 Unsupported
cefsharp/69 3497 2015 4.5.2 Unsupported
cefsharp/67 3396 2015 4.5.2 Unsupported
cefsharp/65 3325 2015 4.5.2 Unsupported
cefsharp/63 3239 2013 4.5.2 Unsupported
cefsharp/62 3202 2013 4.5.2 Unsupported
cefsharp/57 2987 2013 4.5.2 Unsupported
cefsharp/55 2883 2013 4.5.2 Unsupported
cefsharp/53 2785 2013 4.5.2 Unsupported
cefsharp/51 2704 2013 4.5.2 Unsupported
cefsharp/49 2623 2013 4.0 Unsupported
cefsharp/47 2526 2013 4.0 Unsupported
cefsharp/45 2454 2013 4.0 Unsupported
cefsharp/43 2357 2012 4.0 Unsupported
cefsharp/41 2272 2012 4.0 Unsupported
cefsharp/39 2171 2012 4.0 Unsupported
cefsharp/37 2062 2012 4.0 Unsupported

* For .Net Core Packages VC++ 2019 is required
** For .Net Core Packages .Net Core 3.1/.Net 5.0 is required.

 

Visual C++ Redistributable for Visual Studio 2012 Update 4

下載鏈接:https://www.microsoft.com/zh-CN/download/details.aspx?id=30679

Visual C++ Redistributable Packages for Visual Studio 2013

下載鏈接:https://www.microsoft.com/zh-CN/download/details.aspx?id=40784

Visual C++ Redistributable for Visual Studio 2015

下載鏈接:https://www.microsoft.com/zh-CN/download/details.aspx?id=48145

CefSharp中文幫助文檔

文檔鏈接:https://github.com/cefsharp/CefSharp/wiki/CefSharp%E4%B8%AD%E6%96%87%E5%B8%AE%E5%8A%A9%E6%96%87%E6%A1%A3


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM