Не удалось загрузить файл или сборку CefSharp.Core.Runtime.C#

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

Сообщение Anonymous »

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

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


WinExe
netcoreapp3.0
true





Затем я изменил свой файл xaml, чтобы он выглядел следующим образом: Наконец, я добавил следующий конструктор в файл 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);
}
}
}
Когда я запускаю приложение, я получаю следующую ошибку:

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

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#»