Не удалось загрузить файл или сборку cefsharp.core.runtimeC#

Место общения программистов C#
Anonymous
 Не удалось загрузить файл или сборку cefsharp.core.runtime

Сообщение Anonymous »

Я использовал диспетчер пакетов Nuget для установки https://github.com/cefsharp/cefsharp
, который добавил элемент в мой.

Код: Выделить всё


WinExe
netcoreapp3.0
true





< /code>
Далее я изменил свой файл XAML, чтобы выглядеть так: < /p>






Наконец, я добавил следующий конструктор в файл app.xaml.cs :

Код: Выделить всё

namespace csharp {
public partial class App : Application {
public App() {
var settings = new CefSettings() { // Line 12
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
};

settings.CefCommandLineArgs.Add("enable-media-stream");
settings.CefCommandLineArgs.Add("use-fake-ui-for-media-stream");
settings.CefCommandLineArgs.Add("enable-usermedia-screen-capturing");

var dependencyCheck = true;

Cef.Initialize(settings, performDependencyCheck: dependencyCheck, browserProcessHandler: null);
}
}
}
< /code>
Когда я запускаю приложение, я получаю следующую ошибку: < /p>
Exception has occurred: CLR/System.BadImageFormatException
An unhandled exception of type 'System.BadImageFormatException' occurred in CefSharp.Wpf.dll: 'Could not load file or assembly 'CefSharp.Core.Runtime, Version=87.1.132.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138'. An attempt was made to load a program with an incorrect format.'
at CefSharp.CefSettingsBase..ctor()
at CefSharp.Wpf.CefSettings..ctor()
at csharp.App..ctor() in App.xaml.cs:line 12
at csharp.App.Main()
Почему он не может загрузить пакет? />

Подробнее здесь: https://stackoverflow.com/questions/662 ... re-runtime

Вернуться в «C#»