通用 Windows 平台/UAP:什么是 AOT? [英] Universal Windows Platform/UAP: what is AOT?

查看:71
本文介绍了通用 Windows 平台/UAP:什么是 AOT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I recently created a blank UWP application in Visual Studio 2015, and then tried to add a nuget package to that application. The package installation failed and resulted in the following messasges in the output window...

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"中找到了对运行时"的引用;(我的看起来像这样)...

Looking around, I have found references to the "runtimes" within the "project.json"; (mine looks like this)...

{
  "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"的等效运行时有什么区别?

My question is this: what is the difference between each "runtime" and the equivalent runtime with "-aot" appended?

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

I have seen some posts that indicate I can delete these runtimes if I want to use a nuget package that does not support them, but I would prefer to only delete them knowing what they are.

注意:我不知道这是否有什么区别,但我正在构建的 UWP 应用程序预计只会被侧载(它是一个业务线应用程序).然而,它可能最终需要通过 Windows Business 商店分发,以简化更新等.

Note: I do not know if this makes any difference, but the UWP application that I am building is expected to only ever be side-loaded (it is a line of business application). It may however eventually need to be distributed via the Windows Business Store in order to ease updates etc.

谢谢.

推荐答案

运行时是一个通用术语,指的是运行您的代码的任何库、框架或平台.win10-arm 和 win10-arm-aot 运行时是不同的平台.这是一个维基百科:运行时系统.此外,根据维基百科提前(AOT):

Runtime is a general term that refers to any library, framework, or platform that your code runs on. The win10-arm and win10-arm-aot runtimes are different platforms. Here is a Wikipedia: Runtime system. Besides, as per Wikipedia Ahead-of-time (AOT):

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

Ahead-of-time (AOT) compilation is the act of compiling a high-level programming language such as C or C++, or an intermediate language such as Java bytecode or .NET Common Intermediate Language (CIL) code, into a native (system-dependent) machine code with the intention of executing the resulting binary file natively. Some programming languages with a managed code runtime that can be compiled to an intermediate language, take advantage of just-in-time (JIT)

所以我同意 Hans Passant 的观点,AOT 编译器与 System.Reflection.Emit.ILGeneration 包不兼容.所以如果你想使用这个包,你可以删除这些 aot 运行时.

So I agree with Hans Passant, the AOT compiler is incompatible with System.Reflection.Emit.ILGeneration package. So you can delete these aot runtimes if you want to use this package.

这篇关于通用 Windows 平台/UAP:什么是 AOT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆