Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
491 views
in Technique[技术] by (71.8m points)

visual studio 2012 - Adding NuGet ndef library to windows phone 8 project

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:

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.

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...