MSBuild Windows 套件 10 错误 objidl.idl

MSBuild Windows Kits 10 error with objidl.idl

尝试使用来自 TFS2017 服务器的 MSBuild 15.0 构建我的解决方案时,出现以下错误:

C:\Program Files (x86)\Windows Kits\include.0.16299.0\um\objidl.idl (702, 0) C:\Program Files (x86)\Windows Kits\include.0.16299.0\um\objidl.idl(702,0): Error MIDL2072: inapplicable attribute : [ Type 'SNB' ( Interface 'IStorage' ) ]

C:\Program Files (x86)\Windows Kits\include.0.16299.0\um\objidl.idl (742, 0) C:\Program Files (x86)\Windows Kits\include.0.16299.0\um\objidl.idl(742,0): Error MIDL2072: inapplicable attribute : [ Type 'SNB' ( Parameter 'snbExclude' ) ]

我试过不同版本的\include、\lib、\bin文件夹,例如:

无济于事。

非常感谢任何解决此问题的想法或帮助! 谢谢

首先请确保您的本地环境与您的构建agent/server环境相同。

另外,也看看这个类似的问题,也许对你有帮助:

error MIDL2072: inapplicable attribute : [annotation] [ Type 'SNB' ( Interface 'IStorage' )

尝试link中提到的解决方案:

Remove all references on older SDK's binary directories in 'Executable Directories' for 'VC++ Directories' in Properties for 'Microsoft.Cpp.x64.user'; otherwise the wrong (previous) version of the MIDL compiler (that doesn't understand newer SAL/MIDL syntax) will run with possible errors.