2017-02-02 88 views
1

我最近在Visual Studio 2015中創建了一個空白的UWP應用程序,然後嘗試將nuget包添加到該應用程序。該軟件包安裝失敗,並導致在輸出窗口下面messasges ...通用Windows平臺/ UAP:什麼是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-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」之內; (我的是這樣)......

{ 
    "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 業務分銷,以便於更新等。

謝謝。

+1

它意味着「提前」。與「及時」相反。介紹程序集中的中間代碼被編譯爲機器代碼的方式。 UWP中的AOT編譯器被稱爲.NET Native。是的,與Reflection.Emit完全不兼容,因爲它總是需要即時編譯器。你不能在UWP應用程序中使用它。 –

+0

@Martin Robins,這個問題的任何更新?你能從下面的答案中獲得有用的信息嗎? –

回答

2

運行時是一個通用術語,指的是運行代碼的任何庫,框架或平臺。 win10-arm和win10-arm-aot運行時是不同的平臺。這是一個維基百科:Runtime system。 此外,作爲每維基百科Ahead-of-time (AOT)

超前-的時間(AOT)編譯是編譯的高級 編程語言,諸如C或C++,或中間語言 諸如Java字節碼的動作或.NET公共中間語言(CIL)代碼 合併爲本機(系統相關)機器代碼,其目的是 本機執行結果二進制文件。 與

所以我與Hans帕桑特同意,可以編譯成中間語言的託管代碼的運行時,利用剛剛在時間 (JIT)的一些編程語言中,AOT編譯器與系統不兼容.Reflection.Emit.ILGeneration包。所以如果你想使用這個包,你可以刪除這些運行時。