通过Nuget在Windows Phone Store App中引用WindowsAzure.MobileServices.Backend.Security

时间:2014-11-02 21:24:55

标签: .net azure windows-phone nuget azure-mobile-services

我尝试在Windows手机商店应用中引用WindowsAzure.MobileServices.Backend.Security,如本教程所示。

http://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-windows-store-dotnet-get-started-users/

当我运行nuget时:

PM> install-package WindowsAzure.MobileServices.Backend.Security

我收到以下错误:

...
Adding 'Owin 1.0' to xxxx.WindowsPhone.
Uninstalling 'Owin 1.0'.
Successfully uninstalled 'Owin 1.0'.
Install failed. Rolling back...
install-package : Could not install package 'Owin 1.0'. You are trying to install this package into a project that targets 'WindowsPhoneApp,Version=v8.1', but the package does not contain any assembly references or content 
files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ install-package WindowsAzure.MobileServices.Backend.Security
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

我尝试了所有版本的WindowsAzure.MobileServices.Backend.Security包。但

1 个答案:

答案 0 :(得分:1)

Owin NuGet package只有.NET 4.0程序集,因此您无法将其安装到Windows Phone应用程序中。

查看教程,他们将WindowsAzure.MobileServices.Backend.Security NuGet包添加到服务器端Web应用程序中。在Windows Phone App端,他们只需调用服务器端Web应用程序公开的Web服务。