我创建了一个引用两个 Windows SDK 库的 C# .Net 标准库。
参考文献是
C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.Foundation.FoundationContract\3.0.0.0\Windows.Foundation.FoundationContract.winmd
C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.Foundation.UniversalApiContract\5.0.0.0\Windows.Foundation.UniversalApiContract.winmd
这适用于我的本地开发机器。
VS Team Services 构建首先显示以下警告:
2018-06-13T01:17:22.3393846Z ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "Windows.Foundation.FoundationContract". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
后来它失败并出现以下错误:
Error CS0246: The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?)
天真地,我以为我只需在 Visual Studio 中将 Copy Local to True 设置为 true,一切都会好起来的。我错了。
问题
如何在 VSTS 中构建引用 SDKwinmd
文件的项目?