无法解析对 Windows 运行时类型 'Windows.Foundation.Metadata.PlatformAttribute 的依赖

Cannot resolve dependency to Windows Runtime type 'Windows.Foundation.Metadata.PlatformAttribute

请注意,我们正在 Windows 10 上为 运行 构建一个应用程序,但是当我们检查代码时,我们遇到了这些构建错误

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(268, 9): error MC1000: Unknown build error, 'Cannot resolve dependency to Windows Runtime type 'Windows.Foundation.Metadata.PlatformAttribute'. When using the ReflectionOnly APIs, dependent Windows Runtime assemblies must be resolved on demand through the ReflectionOnlyNamespaceResolve event.'  

Windows Server 2012 R2 version 6.3 上似乎缺少这些项目 因为这些是我们的构建服务器,但该应用程序的目标是 Windows 10,因此必须缺少一些其他更深层次的 COM 模块:

C:\WINDOWS\System32\WinMetadata\Windows.Foundation.winmd 
C:\WINDOWS\System32\WinMetadata\Windows.Devices.winmd 

有人有什么建议吗? TIA

更新:

请注意,我花了很多时间研究和解决这个问题。以下是我找到的一些链接,但没有找到解决方案:

Unknown build error Cannot resolve dependency to System.Windows

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b6209e45-642f-4542-a66e-f304cf8baaf2/regasm-quotcannot-resolve-dependency-to-windows-runtime-type-for-net-dll?forum=visualstudiogeneral

Reflecting a WinRT executable from a .Net 4.x App

https://docs.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context

我们没有深入挖掘并试图找出 COM 差异,而是创建了一个 Windows 10 构建服务器。

更新:

另一种选择是将构建服务器从 Windows 2012 升级到 2016。