在Windows Phone 8.1应用程序项目中安装Unity nuget程序包时出错
我正在Windows 10上运行Visual Studio 2015 文件->新建项目->空白应用程序通用Windows 8.1 这将创建一个包含3个项目的解决方案:Windows 8.1项目、Windows Phone 8.1项目和共享项目 如果我尝试安装Unity nuget软件包,会出现以下错误在Windows Phone 8.1应用程序项目中安装Unity nuget程序包时出错,nuget,unity-container,Nuget,Unity Container,我正在Windows 10上运行Visual Studio 2015 文件->新建项目->空白应用程序通用Windows 8.1 这将创建一个包含3个项目的解决方案:Windows 8.1项目、Windows Phone 8.1项目和共享项目 如果我尝试安装Unity nuget软件包,会出现以下错误 Package Manager Console Host Version 3.1.1.0 Type 'get-help NuGet' to see all available NuGet com
Package Manager Console Host Version 3.1.1.0
Type 'get-help NuGet' to see all available NuGet commands.
PM> Install-Package Unity -Version 3.5.1404
Attempting to gather dependencies information for package 'Unity.3.5.1404' with respect to project 'App3\App3.WindowsPhone', targeting 'WindowsPhoneApp,Version=v8.1'
Attempting to resolve dependencies for package 'Unity.3.5.1404' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Unity.3.5.1404'
Resolved actions to install package 'Unity.3.5.1404'
Install failed. Rolling back...
Package 'Unity 3.5.1404' does not exist in project 'App3.WindowsPhone'
Install-Package : Could not install package 'Unity 3.5.1404'. 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 Unity -Version 3.5.1404
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
PM>
Unity在Windows 8.1项目中无误安装
我如何解决这个问题
更新:16/9/2015
我在运行Windows10和VisualStudio2013的工作电脑上也有同样的行为
更新:17/09/2015
设置nuget以显示预发行版软件包,然后安装Unity 3.5.1405-prerelease Unity NuGet软件包版本3.5.1404不支持通用Windows项目 它确实支持Windows Phone Silverlight项目
如果创建Windows Phone Silverlight项目,则可以在其中安装Unity NuGet软件包。我可以通过以下NuGet命令将Unity安装到两个项目中: 安装Unity软件包-预安装
这将安装版本3.5.1405-prerelease。根据Unity的nuget页面,WindowsPhone和WindowsPhone8都列在标记部分。I安装了版本3.5.1405-prerelease,并使用以下nuget命令:Install Package Unity-PreI可以使用以下nuget命令将Unity安装到两个项目中:Install Package Unity-Pre This installs version3.5.1405-预发布。我确信版本3.5.1404应该支持Windows Phone,因为它在nuget页面上被标记。版本3.5.1404不支持通用Windows Phone项目,它只支持Windows Phone Silverlight项目。在3.5.1405-prerelease中,他们更改了可移植类库程序集的配置文件,使其包含wpa,NuGet使用wpa引用通用Windows Phone项目。稳定版本没有支持wpa的PCL。好吧,这在@MattWard是很公平的。我看了杰瑞·尼克松(Jerry Nixon)展示的添加Unity to Win Phone 8.1应用程序的视频,并假设他添加了最新的稳定版本,请参见58:20,但在暂停视频时,他设置了预发布功能。visual studio中默认的nuget不会显示预发布程序包。遗憾的是,他在演讲中没有提到这一点。