将NuGet ndef库添加到Windows Phone 8项目 [英] Adding NuGet ndef library to windows phone 8 project

查看:95
本文介绍了将NuGet ndef库添加到Windows Phone 8项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我尝试为Windows Phone 8应用程序在Visual Studio 2012中为邻近应用程序添加NDEF库.在Package Manager中,我选中了Allow NuGet to download missing packages during build;在Solution Explorer中,我选择了Enable NuGet Package Restore.

So I tried to add the NDEF library for proximity application in Visual Studio 2012 for a Windows Phone 8 app. In Package Manager I checked Allow NuGet to download missing packages during build and in the Solution Explorer I selected Enable NuGet Package Restore.

到目前为止很好,但是当我尝试安装软件包时,出现以下错误:

So far so good, but when i try to install the package I get the following error:

无法安装软件包" NdefLibrary 0.9.0.1 ".您正在尝试将此软件包安装到以" WindowsPhone,Version = v8.0 "为目标的项目中,但是该软件包不包含与该框架兼容的任何程序集引用.有关更多信息,请与程序包作者联系.

Could not install package 'NdefLibrary 0.9.0.1'. You are trying to install this package into a project that targets 'WindowsPhone,Version=v8.0', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.

推荐答案

这在我的开发箱上工作正常.这是我在WP8项目上的NuGet程序包管理器的输出:

This works fine on my dev box. Here's the output from my NuGet package manager on a WP8 project:

PM> Install-Package NdefLibrary
You are downloading NdefLibrary from Andreas Jakl, the license agreement to which is available at https://ndef.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'NdefLibrary 0.9.0.1'.
Successfully added 'NdefLibrary 0.9.0.1' to Wp8TestApp.

您可能缺少的是将NuGet软件包管理器更新到最新版本.转到Visual Studio文件菜单->工具->扩展和更新->更新-> Visual Studio画廊-> NuGet->更新,最后您需要重新启动.之所以需要进行此更新,是因为VS2012 RTM附带的NuGet版本不支持WP8,因为WP8在VS2012之前没有RTM.

What you're probably missing is to update your NuGet package manager to the latest version. Go to Visual Studio File Menu --> Tools --> Extensions and Updates --> Updates --> Visual Studio Gallery --> NuGet --> Update and finally you'll need to restart. The reason why this update is needed is that the NuGet version that ships with VS2012 RTM doesn't support WP8 since WP8 didn't RTM before VS2012 did.

这篇关于将NuGet ndef库添加到Windows Phone 8项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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