2016-08-03 41 views
4

我想在我的项目中更新Microsoft.NETCore.UniversalWindowsPlatform Nuget,但我无法这样做。我目前在5.1.0上,并且正在尝试更新到5.2.2。我尝试更新时的输出如下所示:Microsoft.NETCore.UniversalWindowsPlatform 5.2.2 Nuget更新失败

Restoring packages for 'MyApp'. 
Restoring packages for C:\Users\Shayon\uwp\src\MyApp\project.json... 
System.Reflection.Emit.ILGeneration 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot. 
Some packages are not compatible with UAP,Version=v10.0 (win10-arm-aot). 
System.Reflection.Emit.ILGeneration 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot. 
Some packages are not compatible with UAP,Version=v10.0 (win10-x64-aot). 
System.Reflection.Emit.ILGeneration 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot. 
Some packages are not compatible with UAP,Version=v10.0 (win10-x86-aot). 
Package restore failed for 'MyApp'. 
Package restore failed. Rolling back package changes for 'MyApp'. 
========== Finished ========== 

我不太确定如何解释此错误消息。是否说UWP不支持反射?

我试过清理我的nuget缓存并恢复。我也尝试卸载5.1.0并直接安装到5.2.2。我使用的是Nuget版本3.4.4和VS 2015.我也应该提到,我已经能够在同一个解决方案中更新nuget,以解决其他一些问题。如果这是我的有关万能的Windows最低版本(10.0; Build 10240),我的目标版本是(10.0; Build 10586)

任何想法是怎么回事出错吗?

回答

6

这为我工作:

  1. 删除解决其他项目的所有引用。
  2. 卸载所有nuget软件包(请记住您已安装哪些软件包)
  3. 添加nuget包,从Microsoft.NETCore.UniversalWindowsPlatform 5.2.2包开始。
  4. 对解决方案中的所有项目执行步骤1到3
  5. 为解决方案中的每个项目添加所有必需的项目参考。

按照这个步骤,我可以更新Microsoft.NETCore.UniversalWindowsPlatform软件包以及所有其他软件包,例如Automapper 4.2.1到5.0.2。

+1

这对我有用,但不幸的是,这不得不更新框架。 – CrusherJoe

2

更新到Microsoft.NETCore.UniversalWindowsPlatform:5.2.2是正确的修复方法。在处理使用netstandard的软件包时,这个软件包是必需的。