[UWP] [C ++ / WinRT]使用最新的NuGet包时,C ++ / WinRT应用程序无法编译:Microsoft.Windows.CppWinRT 1.0.181108.4

人气:375 发布:2022-09-22 标签: wpdevelop

问题描述

要复制此问题,请使用visual studio创建默认空白应用程序(C ++ / WinRT)BlankApp1并运行"重建解决方案"。

To replicate the issue, create the default blank app (C++/WinRT) BlankApp1 using visual studio and run 'Rebuild Solution'.

'构建解决方案将一直有效更改是项目的模式,导致编译idl。

'Build Solution will work until significant changes are mode to the project causing a compile of the idl's.

注意:与以前版本的CppWinRT一起使用,v1.0.181002.2。

NOTE: Working fine with previous version of CppWinRT, v1.0.181002.2.

编译错误: -

1> MainPage.idl 1> MIDLRT处理C:\Program Files(x86)\ Windows Kits \10\Include\10.0.17134.0\winrt\winrtbase.idl 1> winrtbase.idl 1> MIDLRT处理C:\Program Files(x86)\ Windows Kits \10\Include\10.0.17134.0\winrt\midlbase.idl 1> midlbase.idl 1>处理WinMD c:\program files(x86)\windows kits \\\\ quote @ \\ .10.0.17134.0 \windows.ai.machinelearning .preview.machinelearningpreviewcontract\1.0.0.0\windows.ai.mach inelearning.preview.machinelearningpreviewcontract.winmd 1>处理WinMD C:\program文件(86)\windows kits\10\references\10.0.17134.0\windows.applicationmodel.calls .callsvoipcontract\3.0.0.0\windows.applicationmodel.calls.callsvoipcontract.winmd 1>处理WinMD c:\program files(x86)\windows kits \\\\ quote \\10.0.17134.0\windows.applicationmodel.socialinfo.socialinfocontract\2.0.0.0\windows.applicationmodel.socialinfo.socialinfocontract.winmd 1>处理WinMD C:\program文件(x86)的\windows kits\10\references\10.0.17134.0\windows.applicationmodel.startuptaskcontract\3.0.0.0\windows.applicationmodel.startuptaskcontract.winmd 1>处理WinMD C: \program files(x86)\ windows与kits \\ adms; \\ 10.0.1.17134.0\windows.devices.custom.customdevicecontract\1.0.0.0\windows.dev ices.custom.customdevicecontract.winmd 1>处理WinMD c:\program files(x86)\windows kits; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\ 03.0.0.0 \windows.devices.deviceslowlevelcontract.winmd 1>处理WinMD c:\program files(x86)\ windows与kits \\\\\\\\\\\\\\\\\\\\ \ ntowsows.devices.printers.printerscontract\1.0.0.0\windows.devices.printers.printerscontract.winmd 1>处理WinMD c:\program files(x86)\ windows套件\10\references\10.0.17134.0\windows.devices.smartcards.smartcardbackgroundtriggercontract\3.0.0.0\windows.devices.smartcards.smartcardbackgroundtriggercontract.winmd 1>处理WinMD C: \program files(x86)\ windows kits\10\references\10.0.17134.0\windows.devices.smartcards.smartcardemulatorcontract\5.0.0.0\windows.devices.smartcards.sma rtcardemulatorcontract.winmd 1>处理WinMD c:\program files(x86)\windows kits \\\\ quote @ \\ .10.0.17134.0\windows.foundation.foundationcontract\3.0。 0.0 \windows.foundation.foundationcontract.winmd 1>处理WinMD c:\program files(x86)\windows kits\10\references\10.0.17134.0\windows。 foundation.universalapicontract\6.0.0.0\windows.foundation.universalapicontract.winmd 1>处理WinMD c:\program files(x86)\windows kits \\\\ quote# 10.0.17134.0\windows.gaming.xboxlive.storageapicontract\1.0.0.0\windows.gaming.xboxlive.storageapicontract.winmd 1>处理WinMD c:\program files(x86)\\ \\windows kits\10\references\10.0.17134.0\windows.graphics.printing3d.printing3dcontract\4.0.0.0\windows.graphics.printing3d.printing3dcontract.winmd 1>处理WinMD c:\\程序文件(x86)\窗口套件\\\ notes / \\ .10.0.17134.0 \windows.networking.connectivity.wwancontract \2.0.0.0 \windows.networking.connectivity.wwancontract.winmd 1>处理WinMD c:\program files(x86)\windows kits; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ .store.storecontract.winmd 1>处理WinMD c:\program files(x86)\windows kits \\\\ quote> \\ .10.0.17134.0 \windows.services.targetedcontent。 targetedcontentcontract\1.0.0.0\windows.services.targetedcontent.targetedcontentcontract.winmd 1>处理WinMD c:\program files(x86)\windows kits \\\\ quote# 10.0.17134.0\windows.system.profile.profilehardwaretokencontract\1.0.0.0\windows.system.profile.profilehardwaretokencontract.winmd 1>处理WinMD c:\program files(x86) \\windows kits\10\references\10.0.17134.0\windows.system.profile.profilesharedmodecontract\2.0.0.0\windows.system.profile.profilesharedmodecontract.winmd 1>处理WinMD C:\program文件(x86)的\windows kits\10\references\10.0.17134.0\windows.ui.viewmanagement.viewmanagementviewscalingcontract\1.0.0.0\windows.ui.viewmanagement.viewmanagementviewscalingcontract.winmd 1> MDMERGE:错误MDM5019:无法打开响应文件E:\Development\Visual。 1> E:\Development\Visual Studio 2017 \Projects\BlankApp1\packages\Microsoft.Windows.CppWinRT.1.0.181108.4\build\\\ative\Microsoft.Windows.CppWinRT.targets(255,9):错误MSB3075:该命令" mdmerge。 exe @E:\Development\Visual Studio 2017 \Projects\BlankApp1 \Debug \ BlankApp1 \mdmerge.rsp" 退出代码5.请确认您有足够的权限运行此命令。 1>完成构建项目"BlankApp1.vcxproj" - 失败。 ==========重建全部:0成功,1失败,0跳过==========

1>MainPage.idl 1>MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\winrt\winrtbase.idl 1>winrtbase.idl 1>MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\winrt\midlbase.idl 1>midlbase.idl 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.ai.machinelearning.preview.machinelearningpreviewcontract\1.0.0.0\windows.ai.machinelearning.preview.machinelearningpreviewcontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.applicationmodel.calls.callsvoipcontract\3.0.0.0\windows.applicationmodel.calls.callsvoipcontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.applicationmodel.socialinfo.socialinfocontract\2.0.0.0\windows.applicationmodel.socialinfo.socialinfocontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.applicationmodel.startuptaskcontract\3.0.0.0\windows.applicationmodel.startuptaskcontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.devices.custom.customdevicecontract\1.0.0.0\windows.devices.custom.customdevicecontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.devices.deviceslowlevelcontract\3.0.0.0\windows.devices.deviceslowlevelcontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.devices.printers.printerscontract\1.0.0.0\windows.devices.printers.printerscontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.devices.smartcards.smartcardbackgroundtriggercontract\3.0.0.0\windows.devices.smartcards.smartcardbackgroundtriggercontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.devices.smartcards.smartcardemulatorcontract\5.0.0.0\windows.devices.smartcards.smartcardemulatorcontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.foundation.foundationcontract\3.0.0.0\windows.foundation.foundationcontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.foundation.universalapicontract\6.0.0.0\windows.foundation.universalapicontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.gaming.xboxlive.storageapicontract\1.0.0.0\windows.gaming.xboxlive.storageapicontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.graphics.printing3d.printing3dcontract\4.0.0.0\windows.graphics.printing3d.printing3dcontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.networking.connectivity.wwancontract\2.0.0.0\windows.networking.connectivity.wwancontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.services.store.storecontract\3.0.0.0\windows.services.store.storecontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.services.targetedcontent.targetedcontentcontract\1.0.0.0\windows.services.targetedcontent.targetedcontentcontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.system.profile.profilehardwaretokencontract\1.0.0.0\windows.system.profile.profilehardwaretokencontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.system.profile.profilesharedmodecontract\2.0.0.0\windows.system.profile.profilesharedmodecontract.winmd 1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17134.0\windows.ui.viewmanagement.viewmanagementviewscalingcontract\1.0.0.0\windows.ui.viewmanagement.viewmanagementviewscalingcontract.winmd 1>MDMERGE : error MDM5019: Could not open the response file E:\Development\Visual. 1>E:\Development\Visual Studio 2017\Projects\BlankApp1\packages\Microsoft.Windows.CppWinRT.1.0.181108.4\build\native\Microsoft.Windows.CppWinRT.targets(255,9): error MSB3075: The command "mdmerge.exe @E:\Development\Visual Studio 2017\Projects\BlankApp1\Debug\BlankApp1\mdmerge.rsp" exited with code 5. Please verify that you have sufficient rights to run this command. 1>Done building project "BlankApp1.vcxproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

推荐答案

我无法复制这个问题与空白的C ++ / winRT项目有关。我正在使用最新的Microsoft.Windows.CppWinRT 1.0.181108.4。我在创建应用程序后尝试重建项目。但它可能会成功。我在Windows 10中运行我的应用程序 Build 1803.我的项目是针对Windows 10 build 17134。

I could not reproduce this issue with the blank C++/winRT project. I'm using the latestMicrosoft.Windows.CppWinRT1.0.181108.4. I tried to rebuild the project after created the app. But it could success. I'm running my app in windows 10 Build 1803. My project is targeting windows 10 build 17134.

你能告诉我你的操作系统版本和目标版本吗?

Could you please tell me your OS version and target version?

祝你好运,

Roy

950