简体   繁体   English

无法在Windows Phone 8.1下的后台任务中创建SQLite连接

[英]Cannot create a SQLite connection in a background task under Windows Phone 8.1

I am working on a Windows Phone 8.1 app and I have some trouble with the SQLite version in a background task. 我正在使用Windows Phone 8.1应用程序,并且在后台任务中使用SQLite版本遇到一些麻烦。 The following code works without any problem in a Windows Phone 8.1 Silverlight App, but if I run it in a background task, it doesn't work. 以下代码在Windows Phone 8.1 Silverlight应用程序中可以正常运行,但是如果我在后台任务中运行它,则它将无法正常工作。

Debugger says "Database xxx (CanNotopen)". 调试器说“数据库xxx(CanNotopen)”。

The code is quite simple. 代码很简单。

 SQLiteConnection connection = new SQLiteConnection(Constants.DATABASE_PATH, true);

Is it necessary to use an absolute path in background tasks? 在后台任务中是否需要使用绝对路径?

Thanks in advance. 提前致谢。

要解决此问题,请使用SQLite.Net PCL并解决问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM