如何在新的Windows 8.1商店应用使用SQLite(Visual Studio的2013年) [英] How to use SQLite on new Windows 8.1 Store app (Visual Studio 2013)

查看:173
本文介绍了如何在新的Windows 8.1商店应用使用SQLite(Visual Studio的2013年)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我安装在我的Windows 8.1箱的Visual Studio 2013。我想用它进行实验,并创建了一个新的 Windows应用商店的应用网格。我想持续SQLite数据库,为的WinRT应用选择显然在数据库上的数据。

So, I installed Visual Studio 2013 on my Windows 8.1 box. I want to experiment with it and created a new Windows Store Grid App. I want to persist data on a SQLite database, apparently the database of choice for WinRT apps.

快速发现链接,以便在需要的VSIX能够使用SDK : SQLite的下载页面和下载的源码,winrt81-3080002.vsix

Quickly found links to the vsix needed in order to be able to use the SDK: SQLite download page, and downloaded sqlite-winrt81-3080002.vsix.

安装,然后在我的项目,添加引用到新安装的SDK(右键单击引用,添加引用,浏览到Windows中,选择扩展和蜱SQLite,让Windows运行时(Windows 8.1中)复选框。

Installed it, then in my project, added the reference to the newly installed SDK (right click references, add reference, navigate to Windows, select extensions and tick SQLite for Windows Runtime (Windows 8.1) checkbox.

也很快发现,它不会将任何CPU上进行编译。在配置管理器,选中的调试,64活跃的平台,让我能够编译应用程序。

Also quickly found that it won't compile on Any CPU. On Configuration Manager, selected Debug, x64 active platform, that made me able to compile the application.

最后,在尝试使用名称空间的SQLite 我注意到VS 2013是不承认它。尝试很多事情一样直接将参考该.dll ,探索成分,看看哪些命名空间是可利用的(不显示任何东西),我赶紧跑出来的想法。因为它还挺新的东西,并与兴趣有限,谷歌,救世主,不希望今天救我。

Finally, while attempting to use the namespace SQLite I noticed VS 2013 isn't recognizing it. Attempted many things like adding reference to the .dll directly, exploring the component to see which namespaces were available (which doesn't show anything), and I'm quickly running out of ideas. Because it's kinda new thing, and with limited interest, google, the saviour, doesn't want to save me today.

那么,怎么一会才能使用SQLite的SDK在自己的Visual Studio 2013的项目,针对Windows运行时8.1?

So, how one would be able to use the SQLite SDK in their Visual Studio 2013 projects, targeting Windows Runtime 8.1?

这些内容我的csproj文件

更新
愚蠢的我,觉得有在Metro风格没有管理的土地(.NET)土地。抱歉造成任何混乱。

UPDATE Stupid me, thought there was no managed land (.net) in Metro style land. Sorry for causing any confusion.

推荐答案

我安装了VSIX为SQLite和发现它是在Windows中使用的原生DLL 8.1存放C ++应用程序。它不是托管的C#项目。

I installed the VSIX for SQLite and noticed that it is a native DLL to be used in Windows Store 8.1 C++ apps. It is not for managed C# projects.

目前的NuGet包的SQLite从什么似乎是官方的SQLite队只工作了.NET 4.5,如果你尝试安装它,它会错误说其不支持.NET 4.51。

The current NuGet package for SQLite from what seems to be the 'official' SQLite team is only working for .NET 4.5, if you try to install it, it will error saying it does not support .NET 4.51.

还有一个包的NuGet SQLite的网,它适用于.NET的Windows Store应用程序。所有你需要补充的是using语句SQLite的。

There is also the NuGet package SQLite-net, which works for .NET Windows Store apps. All you need to add is the SQLite using statement.

您将需要此的NuGet包,因为它是SQLite的托管包装,没有你将不能够正常参考SQLite的正确DLL。

You will need this NuGet package as it is the managed wrapper for the SQLite, without you will not be able to properly reference the right DLL for SQLite.

下面是从的NuGet包的链接项目信息。 SQLite的运行时支持

Here is the link to the project information from that NuGet package. SQLite Runtime Support

下面是关于如何使用SQLite与VS2012的Windows Store应用程序的文章,但它仍然应该都适用:

Here is an article on how to use SQLite with Windows Store apps in VS2012 but it should still all apply:

SQLite和Windows商店应用

这篇关于如何在新的Windows 8.1商店应用使用SQLite(Visual Studio的2013年)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆