简体   繁体   English

如何在新的Windows 8.1商店应用程序上使用SQLite(Visual Studio 2013)

[英]How to use SQLite on new Windows 8.1 Store app (Visual Studio 2013)

So, I installed Visual Studio 2013 on my Windows 8.1 box. 所以,我在Windows 8.1机器上安装了Visual Studio 2013。 I want to experiment with it and created a new Windows Store Grid App . 我想试验它并创建一个新的Windows应用商店网格应用 I want to persist data on a SQLite database, apparently the database of choice for WinRT apps. 我想在SQLite数据库上保留数据,显然是WinRT应用程序的首选数据库。

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. 快速找到所需的vsix链接,以便能够使用SDK: SQLite下载页面 ,并下载sqlite-winrt81-3080002.vsix。

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. 安装它,然后在我的项目中,添加对新安装的SDK的引用(右键单击引用,添加引用,导航到Windows,选择扩展并勾选SQLite for Windows Runtime(Windows 8.1)复选框。

Also quickly found that it won't compile on Any CPU. 还很快发现它不能在任何CPU上编译。 On Configuration Manager, selected Debug, x64 active platform, that made me able to compile the application. 在Configuration Manager上,选择了Debug,x64活动平台,这使我能够编译应用程序。

Finally, while attempting to use the namespace SQLite I noticed VS 2013 isn't recognizing it. 最后,在尝试使用命名空间SQLite我注意到VS 2013没有识别它。 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. 尝试了很多东西,例如直接添加对.dll的引用,探索组件以查看哪些命名空间可用(哪些没有显示任何内容),而且我很快就没有想法了。 Because it's kinda new thing, and with limited interest, google, the saviour, doesn't want to save me today. 因为它有点新鲜,并且利益有限,谷歌,救世主,今天不想救我。

So, how one would be able to use the SQLite SDK in their Visual Studio 2013 projects, targeting Windows Runtime 8.1? 那么,如何在针对Windows Runtime 8.1的Visual Studio 2013项目中使用SQLite SDK呢?

These are the contents of my csproj file 这些是我的csproj文件的内容

UPDATE Stupid me, thought there was no managed land (.net) in Metro style land. 更新愚蠢的我,以为在地铁风格的土地上没有管理的土地(.net)。 Sorry for causing any confusion. 很抱歉造成任何混淆。

I installed the VSIX for SQLite and noticed that it is a native DLL to be used in Windows Store 8.1 C++ apps. 我为SQLite安装了VSIX,并注意到它是在Windows Store 8.1 C ++应用程序中使用的本机DLL。 It is not for managed C# projects. 它不适用于托管C#项目。

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. 目前似乎是“官方”SQLite团队的SQLite的当前NuGet包只适用于.NET 4.5,如果你尝试安装它,它会错误地说它不支持.NET 4.51。

There is also the NuGet package SQLite-net, which works for .NET Windows Store apps. 还有NuGet包SQLite-net,适用于.NET Windows应用商店应用。 All you need to add is the SQLite using statement. 您需要添加的只是SQLite using语句。

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的托管包装器,您将无法正确引用SQLite的正确DLL。

Here is the link to the project information from that NuGet package. 这是NuGet包中项目信息的链接。 SQLite Runtime Support SQLite运行时支持

Here is an article on how to use SQLite with Windows Store apps in VS2012 but it should still all apply: 这是一篇关于如何在VS2012中使用SQLite与Windows应用商店应用的文章,但它仍然应用:

SQLite and Windows Store Apps SQLite和Windows应用商店应用

暂无
暂无

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

相关问题 如何在没有Visual Studio的情况下构建Windows应用商店应用? - How to build Windows Store 8.1 app without Visual Studio? '关联应用程序与商店'选项没有显示是视觉工作室终极2013年的Windows Phone 8.1 Silverlight项目 - 'Associate App with the store' option is not showing is visual studio ultimate 2013 for windows phone 8.1 silverlight project 如何在SQLite和Visual Studio 2013中使用EF - How to use EF with SQLite and Visual Studio 2013 如何使用Visual Studio 2013(在Windows 8.1上运行)创建raspberry pi 2应用(运行Windows 10的RPI2)? - can I use visual studio 2013 (run on windows 8.1 ) to Create raspberry pi 2 app (RPI2 Running Windows 10 )? 更改Windows Store应用程序Visual Studio 2013的背景 - Change background of Windows Store app Visual Studio 2013 C#使用Visual Studio 2013与PHP进行交互并制作Windows 8.1 Universal App - C# interacting with PHP using Visual Studio 2013 and making Windows 8.1 Universal App Windows Phone 8.1使用Visual Studio Ultimate 2013构建appx文件 - Windows Phone 8.1 build appx file with Visual Studio Ultimate 2013 如何从Windows 8.1上的Visual Studio 2013 C#解决方案开始使用DirectInput? - How to get started with DirectInput from a Visual Studio 2013 C# solution on Windows 8.1? 如何在Visual Studio 2013中制作Windows Phone 8应用的幻灯片显示? - how to make a slideshow for windows phone 8 app in visual studio 2013? 适用于Visual Studio 2013的SQLite - SQLite for Visual Studio 2013
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM