引用多个 API-Extension 时无法在 "Release" 中构建 W10 UWP 应用

Unable to build a W10 UWP app in "Release" when referenced more than one API-Extension

在我的 Windows 10 通用应用程序中,我引用了 Windows Mobile Extensions for the UWP 以及 Windows Desktop Extensions for the UWP。一切正常并在 "Debug" 中编译,但在 "Release" 中尝试编译时出现以下错误。当仅引用一个扩展时,应用程序也会在 "Release".

中编译

Fehler Der Befehl ""C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x86\ilc\ilc.exe" /in:"C:\Users\myName\PROJECTS\myApp\myApp\obj\x86\Release\ilc\in" /out:"C:\Users\myName\PROJECTS\myApp\myApp\bin\x86\Release\ilc" /intermediatespath:"C:\Users\myName\PROJECTS\myApp\myApp\obj\x86\Release\ilc\intermediate" /v:normal /keepintermediates:true /buildtype:ret /exename:"myApp.exe" /makepripath:"C:\Program Files (x86)\Windows Kits\bin\x64\MakePri.exe" /appPriProjectRoot:"C:\Users\myName\PROJECTS\myApp\myApp" /rcpath:"C:\Program Files (x86)\Windows Kits\bin\x86\rc.exe" /targetplatformsdklibpath:"C:\Program Files (x86)\Windows Kits\lib.0.10240.0\um" /targetplatformsdkmetadatapath:"C:\Users\myName\PROJECTS\myApp\myApp\obj\x86\Release\ilc\in\WinMetadata" /targetframeworkpath:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Activation.ActivatedEventsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Activation.ActivationCameraSettingsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Activation.ContactActivatedEventsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Activation.WebUISearchActivatedEventsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Background.BackgroundAlarmApplicationContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Calls.CallsPhoneContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Calls.CallsVoipContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Calls.LockScreenCallContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.CommunicationBlocking.CommunicationBlockingContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Resources.Management.ResourceIndexerContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Search.Core.SearchCoreContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Search.SearchContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.SocialInfo.SocialInfoContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.ApplicationModel.Wallet.WalletContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Devices.Custom.CustomDeviceContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Devices.Portable.PortableDeviceContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Devices.Printers.Extensions.ExtensionsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Devices.Printers.PrintersContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Devices.Scanners.ScannerDeviceContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Devices.SmartCards.SmartCardBackgroundTriggerContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Devices.SmartCards.SmartCardEmulatorContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Devices.Sms.LegacySmsApiContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Embedded.DeviceLockdown.DeviceLockdownContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Gaming.Preview.GamesEnumerationContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Graphics.Printing3D.Printing3DContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Management.Deployment.Preview.DeploymentPreviewContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Management.Workplace.WorkplaceSettingsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Media.Capture.AppCaptureContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Media.Capture.CameraCaptureUIContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Media.Devices.CallControlContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Media.MediaControlContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Media.Playlists.PlaylistsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Media.Protection.ProtectionRenewalContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Networking.NetworkOperators.LegacyNetworkOperatorsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Networking.NetworkOperators.NetworkOperatorsFdnContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Networking.Sockets.ControlChannelTriggerContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Phone.PhoneContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Phone.StartScreen.DualSimTileContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Security.EnterpriseData.EnterpriseDataContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Security.ExchangeActiveSyncProvisioning.EasContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Services.Maps.GuidanceContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Services.Maps.LocalSearchContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.System.Profile.ProfileHardwareTokenContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.System.Profile.ProfileRetailInfoContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.System.Profile.SystemManufacturers.SystemManufacturersContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.System.UserProfile.UserProfileContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.System.UserProfile.UserProfileLockScreenContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.UI.ApplicationSettings.ApplicationsSettingsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.UI.Core.AnimationMetrics.AnimationMetricsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.UI.Core.CoreWindowDialogsContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.UI.WebUI.Core.WebUICommandBarContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.UI.Xaml.Hosting.HostingContract.0.0.0" /externalReferencePath:"C:\Program Files (x86)\Windows Kits\References\Windows.Web.Http.Diagnostics.HttpDiagnosticsContract.0.0.0" /RdXmlPath:"C:\Program Files (x86)\MSBuild\Microsoft.NetNative\LibraryXML" /suppressPDBWarnings:true /AllowNoManagedCode /UseCustomFramework "/logger:CsvLogger;4288;2796"" wurde mit dem Code 1004 beendet.

目前的 Win10 SDK 10240 似乎有一些关于发布的问题 - 这意味着启用了 .NET Native - 构建。

这篇link可能会对您有所帮助。在我的案例中,我已经成功地使用更新的 .target 文件制作了发布版本。

RTM Known Issue: Release configuration fails to build on using Desktop and Mobile Extension SDKs in a Universal Windows app

2015 年 10 月 6 日编辑 - SDK 1.1 似乎已修复此问题。

What's new for .NET and UWP in Win10 Tools 1.1