MVVMCross UWP 응용 프로그램에서 SQLite를 사용하려고합니다. 그러나, 곧 내가 내 데이터 액세스 레이어의 등록 된 인스턴스를 해결하려고, 나는 다음과 같은 오류 얻을 :MVVMCross가있는 UWP에서 SQLite 사용
여기Exception thrown: 'System.IO.FileLoadException' in MyApp.Core.dll
Additional information: Could not load file or assembly 'SQLite.Net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
는이 충돌 :
private void AddProduct()
{
ICrudEntityDataAccess da = Mvx.Resolve<ICrudEntityDataAccess>();
da.Create<Product>(Product); // Runtime error
}
UWP 앱이 Nuget를 참조를 패키지 :
SQLite.Net.Platform.WinRT
그리고 핵심 응용 프로그램 참조 :
SQLite.Net.Core-PCL
그리고
Sqlite.Net-PCL
은 여기에 등록 :
protected override void InitializeFirstChance()
{
base.InitializeFirstChance();
MvxSimpleIoCContainer.Instance.RegisterSingleton<IPlatformSpecific>(
new PlatformSpecific()
{
LocalFolderPath =
Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path,
"db.sqlite")
});
MvxSimpleIoCContainer.Instance.RegisterSingleton<ISQLitePlatform>(
new SQLitePlatformWinRT());
은 분명히 나는 NuGet 패키지가있는 프로젝트에 필요한이의 핵심 부분 (나는 관계로 추측하고있어보고 싶었어. 누군가 제게 올바른 방향으로 나를 가르쳐 줄 수 있습니까?
나는 이것을 시도하고, 처음에는 차이가 없었다. 내가 끝낸 것은 Nuget 참조를 제거하고 다시 추가하는 것이 었습니다. 그것은 효과가있었습니다. 많은 감사합니다. –