通用Windows平台/ UAP:什么是AOT?

时间:2017-02-02 17:20:36

标签: windows visual-studio-2015 uwp nuget nuget-package

我最近在Visual Studio 2015中创建了一个空白的UWP应用程序,然后尝试将nuget包添加到该应用程序中。软件包安装失败,导致输出窗口中出现以下消息......

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.
One or more packages are incompatible 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.
One or more packages are incompatible 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.
One or more packages are incompatible with UAP,Version=v10.0 (win10-x86-aot).

环顾四周,我发现了"运行时"在" project.json&#34 ;; (我看起来像这样)......

{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

我的问题是:每个"运行时"之间的区别是什么?和" -aot"等效的运行时;所附?

我看过一些帖子表明我可以删除这些运行时如果我想使用不支持它们的nuget包,但我更愿意只删除它们知道它们是什么。

注意:我不知道这是否有任何区别,但我正在构建的UWP应用程序预计只会被侧载(这是业务线应用程序)。但最终可能需要通过Windows Business 商店进行分发,以便于更新等。

感谢。

2 个答案:

答案 0 :(得分:3)

运行时是一个通用术语,指代运行代码的任何库,框架或平台。 win10-arm和win10-arm-aot运行时是不同的平台。这是维基百科:Runtime system。 此外,根据维基百科Ahead-of-time (AOT)

  

Ahead-of-time(AOT)编译是编译高级别的行为   编程语言,如C或C ++,或中间语言   例如Java字节码或.NET公共中间语言(CIL)代码,   意图的本机(系统相关的)机器代码   本地执行生成的二进制文件。       一些具有托管代码运行时的编程语言可以编译为中间语言,利用及时   (JIT)

所以我同意Hans Passant,AOT编译器与System.Reflection.Emit.ILGeneration包不兼容。因此,如果要使用此包,可以删除这些运行时。

答案 1 :(得分:1)

我找到了解决我案件的方法。我的解决方案中有几个项目,所有的项目都在使用

  

Microsoft.NETCore.UniversalWindowsPlatform V 5.2.3

一个项目除外。它正在使用

  

Microsoft.NETCore.UniversalWindowsPlatform V 5.0.0

当我将5.0.0更新为5.2.3时,所有错误都消失了。

注意:您不需要从JSON文件中删除aot标签。