使用 .NET Native Tool Chain 编译在 Server 2016 中失败但在 Windows 10 中成功
Compile with .NET Native Tool Chain fails in Server 2016 but succeeds in Windows 10
我们创建了一个 UWP 项目,它在 Windows 10 台机器上编译了很好的 .Net Native Tool 链选项。
但是,它在 Windows Server 2016 Standard,即构建服务器中失败。
已尝试更改目标版本但没有帮助。
这是错误和警告:-
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5):警告:ILTransform_0005:类型 'Windows.ApplicationModel.Activation.BackgroundActivatedEventArgs' 未包含在编译,但在方法 'App.OnBackgroundActivated(BackgroundActivatedEventArgs)' 中被引用。可能缺少程序集。
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5): 警告:ILTransform_0003: 方法 'App.d__14.MoveNext()' 将始终抛出一个由于缺少方法 'BackgroundActivatedEventArgs.get_TaskInstance()' 而导致的异常。可能缺少程序集。
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5):错误:ILT0021:无法解析方法 'System.Void Windows.UI.Xaml.Application.OnBackgroundActivated($ILT$FakeType0_Windows_ApplicationModel_Activation_BackgroundActivatedEventArgs)'
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5): 错误:类型 'Windows.ApplicationModel.Activation.BackgroundActivatedEventArgs' 未包含在编译中,但在中被引用方法'App.OnBackgroundActivated(BackgroundActivatedEventArgs)'。可能缺少程序集。
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5): error : 方法 'App.d__14.MoveNext()' 将始终抛出异常,因为缺少方法'BackgroundActivatedEventArgs.get_TaskInstance()'。可能缺少程序集。
请安装与应用的目标和最低版本相匹配的存档 SDK,它会很好地编译为本机目标。对于 sdk 存档,请参考此 link
我们创建了一个 UWP 项目,它在 Windows 10 台机器上编译了很好的 .Net Native Tool 链选项。
但是,它在 Windows Server 2016 Standard,即构建服务器中失败。
已尝试更改目标版本但没有帮助。
这是错误和警告:-
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5):警告:ILTransform_0005:类型 'Windows.ApplicationModel.Activation.BackgroundActivatedEventArgs' 未包含在编译,但在方法 'App.OnBackgroundActivated(BackgroundActivatedEventArgs)' 中被引用。可能缺少程序集。
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5): 警告:ILTransform_0003: 方法 'App.d__14.MoveNext()' 将始终抛出一个由于缺少方法 'BackgroundActivatedEventArgs.get_TaskInstance()' 而导致的异常。可能缺少程序集。
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5):错误:ILT0021:无法解析方法 'System.Void Windows.UI.Xaml.Application.OnBackgroundActivated($ILT$FakeType0_Windows_ApplicationModel_Activation_BackgroundActivatedEventArgs)'
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5): 错误:类型 'Windows.ApplicationModel.Activation.BackgroundActivatedEventArgs' 未包含在编译中,但在中被引用方法'App.OnBackgroundActivated(BackgroundActivatedEventArgs)'。可能缺少程序集。
- C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(936,5): error : 方法 'App.d__14.MoveNext()' 将始终抛出异常,因为缺少方法'BackgroundActivatedEventArgs.get_TaskInstance()'。可能缺少程序集。
请安装与应用的目标和最低版本相匹配的存档 SDK,它会很好地编译为本机目标。对于 sdk 存档,请参考此 link