C# 无法将依赖项解析为Windows运行时类型';窗体.Meta平台属性
请注意,我们正在构建一个在Windows 10上运行的应用程序,但当我们签入代码时,会出现这些构建错误C# 无法将依赖项解析为Windows运行时类型';窗体.Meta平台属性,c#,msbuild,windows-10,teamcity,windows-server-2012,C#,Msbuild,Windows 10,Teamcity,Windows Server 2012,请注意,我们正在构建一个在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.Plat
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 6.3版的
由于这些是我们的构建服务器,但该应用程序针对的是Windows 10
,因此肯定缺少一些其他更深层次的COM模块:
C:\WINDOWS\System32\WinMetadata\Windows.Foundation.winmd
C:\WINDOWS\System32\WinMetadata\Windows.Devices.winmd
有人有什么建议吗?短暂性脑缺血发作
更新:
请注意,我已经花了很多时间研究和解决这个问题。以下是我找到的几个链接,但它们没有找到解决方案:
我们没有深入研究并试图找出COM之间的差异,而是创建了一个Windows 10构建服务器
更新:
另一个选项是将生成服务器从Windows 2012升级到2016。我收到了相同的错误。在我的例子中,我正在我的Windows8.1系统中使用Windows10项目(带有toast通知…)。这就是原因吗?因为同一个项目可以克隆并在另一个windows 10项目中运行。我认为问题在于,您的windows 10项目需要某些仅在windows 10上才能找到的模块,如windows.Devices.winmd。所以,即使您在VisualStudio中处理一个“Win10”项目,它也不会工作,因为缺少依赖项。