Car*_*ert 5 c# xamarin.forms xamarin.uwp sqlite-net-pcl
当我调试 UWP 项目时,出现以下错误:
System.IO.FileNotFoundException: '无法加载文件或程序集 'e_sqlite3,Culture=neutral,PublicKeyToken=null'。该系统找不到指定的文件。'
错误发生在这一行:
Xamarin.Forms.Forms.Init(e);
从以下代码块:
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
Xamarin.Forms.Forms.Init(e);
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
}
Run Code Online (Sandbox Code Playgroud)
一点背景知识...我从解决方案中的 3 个项目(共享库、WPF 和 Android)开始。该应用程序当前正在读取和写入 Android 和 WPF 项目中的 sqlite 文件。
我刚刚添加了 UWP 项目。添加对共享库的引用并添加相关的nuget包后,我在调试UWP项目时遇到错误。
这是我当前的解决方案: 解决方案资源管理器的屏幕截图
我正在使用 SQLite-net-pcl nuget 版本 1.5.231(发布时最新的稳定版本)。 nuget 包的截图
我也有 SQLiteNetExtensions 和 SQLiteNetExtensions.Async nuget 包。 所有与 sqlite 相关的 nuget 包的屏幕截图
我的 UWP 项目有:目标版本:Windows 10,版本 1809 最小版本:Windows 10 Fall Creators Update UWP Target 设置截图
我发现了很多关于这个问题的帖子,但它们似乎都表明这在 SQLite-net-pcl 版本 1.5.166 中得到了解决,我正在使用更新的版本。
另一篇文章提到在 Visual Studio 中使用 sqlite 扩展,但我找不到。那个帖子已经有几年了,所以修复可能不相关,因为它引用了 Visual Studio 2015。
我使用的是 Visual Studio Professional 2017,版本 15.9.9。在装有所有最新更新和服务包的 Windows 10 专业版工作站上运行。
有没有人对如何解决这个问题有任何建议?
归档时间: |
|
查看次数: |
1079 次 |
最近记录: |