Xamarin.forms Microsoft.NetNative编译导致警告ILT0003

Xamarin.forms Microsoft.NetNative编译导致警告ILT0003,xamarin.forms,uwp,Xamarin.forms,Uwp,我正在尝试用Xamarin.Forms构建我的第一个UWP应用程序。但是,当我在发布版本中编译时,我总是会遇到这些错误,在这种状态下启动应用程序会导致启动屏幕锁定 3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warnin

我正在尝试用Xamarin.Forms构建我的第一个UWP应用程序。但是,当我在发布版本中编译时,我总是会遇到这些错误,在这种状态下启动应用程序会导致启动屏幕锁定

3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'FormsApp.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'DarkThemeResources.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'DefaultThemeResources.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'LightThemeResources.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'ContactPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'DataPrivacySettingsPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'HelpPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'ImageViewerPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'InAppPurchasingPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'InformationPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'LegalContentPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0005: Type 'Xamarin.Forms.CheckBox' from assembly 'Xamarin.Forms.Core' was not included in compilation, but was referenced in method 'MapDownloadPage.InitializeComponent()'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'MapPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'MasterPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'SettingsPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'StatisticPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'WebViewPage.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.3\tools\Microsoft.NetNative.targets(801,5): warning : ILTransform : warning ILT0003: Method 'MainMenuViewCell.InitializeComponent()' will always throw an exception due to the missing method 'ResourceLoader.ResourceLoadingQuery.set_Instance(object)' in assembly 'Xamarin.Forms.Core'. There may have been a missing assembly, or a dependency on a more recent Windows SDK release.
3>  Cleaning up unreferenced code
3>  Generating native code
3>  Generating fixups for native code

我不知道该怎么处理这个错误。我能以某种方式避免这个错误吗?或者我必须避免“使用.NET本机工具链编译”选项吗?

它可以在调试模型中运行吗?我想
UWPNuGetPackages
不支持发布模式。可以显示更多关于
UWPNuGetPackages
?@Nico Zhu-MSFT的信息,如前所述,这只发生在发布版本中。为什么它不能运行发布版本?这毫无意义。没有理由将调试版本发布到存储区,因此如果不支持发布版本,则整个函数应该根本不存在。另外,消息清楚地表明链接器破坏了构建(因为InitializeComponent()不能错过),所以唯一的问题是,如何防止链接器出现这种行为。是的,我可以理解你的观点,可以为我们分享一个例子吗?如果我知道问题的原因,我可以分享一个例子,或许可以解决这个问题。但是我在这个项目开发了半年之后添加了UWP,所以我不知道是哪些组件导致了这个问题。如果日志中有某种提示或者VS可以附加到发布版本以识别问题,那就太好了。。。即使使用Console打印,也没有调用我的任何方法。甚至不是app类的构造函数..我想是您引用的某个nuget包导致了这个问题。能否共享您使用的nuget软件包?它能否在调试模型中运行?我想
UWPNuGetPackages
不支持发布模式。可以显示更多关于
UWPNuGetPackages
?@Nico Zhu-MSFT的信息,如前所述,这只发生在发布版本中。为什么它不能运行发布版本?这毫无意义。没有理由将调试版本发布到存储区,因此如果不支持发布版本,则整个函数应该根本不存在。另外,消息清楚地表明链接器破坏了构建(因为InitializeComponent()不能错过),所以唯一的问题是,如何防止链接器出现这种行为。是的,我可以理解你的观点,可以为我们分享一个例子吗?如果我知道问题的原因,我可以分享一个例子,或许可以解决这个问题。但是我在这个项目开发了半年之后添加了UWP,所以我不知道是哪些组件导致了这个问题。如果日志中有某种提示或者VS可以附加到发布版本以识别问题,那就太好了。。。即使使用Console打印,也没有调用我的任何方法。甚至不是app类的构造函数..我想是您引用的某个nuget包导致了这个问题。可以共享您使用的nuget软件包吗?