C# Microsoft.NETCore.UniversalWindowsPlatform 5.2.2 Nuget更新失败

C# Microsoft.NETCore.UniversalWindowsPlatform 5.2.2 Nuget更新失败,c#,visual-studio,nuget,uwp,C#,Visual Studio,Nuget,Uwp,我正在尝试更新项目中的Microsoft.NETCore.UniversalWindowsPlatform Nuget,但无法更新。我目前使用的是5.1.0,我正在尝试更新到5.2.2。尝试更新时的输出如下所示: Restoring packages for 'MyApp'. Restoring packages for C:\Users\Shayon\uwp\src\MyApp\project.json... System.Reflection.Emit.ILGeneration 4.0.1

我正在尝试更新项目中的Microsoft.NETCore.UniversalWindowsPlatform Nuget,但无法更新。我目前使用的是5.1.0,我正在尝试更新到5.2.2。尝试更新时的输出如下所示:

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;版本10240)
,目标版本是
(10.0;版本10586)

你知道这里出了什么问题吗?

这对我很有用:

  • 删除对解决方案中其他项目的所有引用
  • 卸载所有nuget软件包(记住已安装的软件包)
  • 从Microsoft.NETCore.UniversalWindowsPlatform5.2.2包开始,重新添加nuget包
  • 对解决方案中的所有项目执行步骤1到3
  • 为解决方案中的每个项目添加所有必要的项目引用

  • 按照此过程,我可以更新Microsoft.NETCore.UniversalWindowsPlatform的
    软件包以及所有其他出现相同错误的软件包,如Automapper 4.2.1到5.0.2。

    更新到Microsoft.NETCore.UniversalWindowsPlatform:5.2.2是正确的修复方法。每当处理使用netstandard的包时,都需要这个包。

    这对我来说很有效,但不幸的是,必须这样做才能更新框架。