找不到SDK"SQLite.WinRT"; -添加引用显示"TargetPlatformWinMDLocation属性的缺少值"; [英] Could not find SDK "SQLite.WinRT" - Add Reference shows "Missing value for TargetPlatformWinMDLocation property"

查看:144
本文介绍了找不到SDK"SQLite.WinRT"; -添加引用显示"TargetPlatformWinMDLocation属性的缺少值";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个使用Typescript,WinJS和持久本地数据库的多设备混合应用程序.我已经将其工作到渲染WinJS控件的地步.

I'm trying to create a Multi-device hybrid app that uses Typescript, WinJS, and a persistent local database. I've got it working to the point of rendering WinJS controls.

但是,当我尝试根据添加Cordova插件的说明添加WebSQL功能(转到plugin选项卡下的config.xml文件->,选中WebSQL Polyfill)时,它将不再编译.

However, when I attempt to add WebSQL functionality according to the instructions for adding a Cordova plugin (go to config.xml file--> under plugins tab, check WebSQL Polyfill), it will no longer compile.

编译器错误为C:\ Program Files(x86)\ MSBuild \ 12.0 \ bin \ amd64 \ Microsoft.Common.CurrentVersion.targets(1886,5):错误MSB3774:找不到SDK"SQLite. WinRT,版本= 3.8.2. [C:\ Users \ Lee \ Documents \ JSApps \ TurnstileTS \ TurnstileTS \ bld \ Debug \ platforms \ windows8 \ CordovaApp.jsproj]

我拥有SQLite二进制文件的所有最新版本(Win8和Win8.1).我意识到该插件似乎依赖于v3.8.2,因此我尝试使用命令行添加NuGet软件包:

I have all the latest versions of the SQLite binaries (both Win8 and Win8.1). I realize that the plugin seems to depend on v3.8.2, so I tried to add the NuGet package using the command line:

安装软件包SQLitePCL-版本3.8.2

此安装成功,但是下一组消息是:

This installed successfully, but the next set of messages was:

找不到对Windows运行时扩展SDK SQLite的引用. 确认对Windows运行时扩展SDK SQLite的引用已被删除. 卸载"SQLitePCL 3.8.2.0". 已成功卸载"SQLitePCL 3.8.2.0". 安装失败.正在回滚...

Unable to find a reference to the extension SDK SQLite for Windows Runtime. Verify that the reference to the extension SDK SQLite for Windows Runtime has already been removed. Uninstalling 'SQLitePCL 3.8.2.0'. Successfully uninstalled 'SQLitePCL 3.8.2.0'. Install failed. Rolling back...

这让我发疯.我通常是C#用户,所以我意识到这可能很简单...但是我什至无法像其他stackoverflow建议状态那样添加对dll的引用.当我右键单击该项目并尝试添加引用..."时,出现错误消息:

This is driving me crazy. I'm normally a C# person, so I realize this might be something simple... but I can't even add a reference to a dll like some other stackoverflow suggestions state. When I right-click on the project and try to "Add Reference..." I get the error message:

TargetPlatformWinMDLocation属性的缺失值.

Missing value for TargetPlatformWinMDLocation property.

...然后什么都没有.

...then nothing.

有什么想法吗?

[edit]我安装了SQLite 3.8.6的Win8,Win8.1,WP8,WP8.1版本.我刚刚尝试构建该应用程序的Windows Phone版本,并且可以运行!但是,Windows 8无法构建.我将其设置为x86而不是AnyCPU,并且它不会更改任何内容.

[edit] I have Win8, Win8.1, WP8, WP8.1 version of SQLite 3.8.6 installed. I just tried building a Windows Phone version of the app and it works! However, Windows 8 won't build. I set it to x86 instead of AnyCPU and it doesn't change anything.

推荐答案

对此有一个非常简单的解决方法.对于Windows 8,您需要已经安装了用于SQLite的VSIX软件包.请注意您已安装的版本号!截至2014年10月26日,我已经安装了3.8.7.

There's a very simple fix to this. For Windows 8, you need to have the VSIX packages for SQLite already installed. Please, note which version number you have installed! As of 10/26/14, I have 3.8.7 installed.

从资源管理器中解决方案的文件夹中,导航至:

From your solution's folder in explorer, navigate to:

{solution folder}\JavaScript\{project name}\bld\Debug\platforms\windows8

在文本编辑器中编辑项目的jsproj文件,然后向下滚动直到看到SQLite条目.

Edit the project's jsproj file in a text editor and scroll down until you see the entries for SQLite.

<ItemGroup>
    <SDKReference Include="SQLite.WinRT, Version=3.8.7" />
</ItemGroup>

将文件中的版本号更改为计算机上的实际版本.该项目将在启用WebSQL插件的情况下构建,并且将实际运行. (我验证了在本地存储中创建的数据库文件.)

Change the version number in your file to the actual version on your computer. The project will build with the WebSQL plugin enabled and will actually work. (I verified the database file created in local storage.)

注意-您必须已经在config.xml菜单中启用了WebSQL插件.

NOTE - You must already have enabled the WebSQL plugin in the config.xml menu.

这篇关于找不到SDK"SQLite.WinRT"; -添加引用显示"TargetPlatformWinMDLocation属性的缺少值";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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