这是一个真正无用的信息警告。我认为将所有中间文件定向到临时文件夹是一个好主意。至少在 C++ 方面。
警告是由于 VS2017 Microsoft.CppBuild.targets(395) 中的设置引起的:
<VCMessage Code="MSB8029" Type="Warning" Condition="'$(DesignTimeBuild)'!='true' and '$(IgnoreWarnIntDirInTempDetected)' != 'true' and ('$(_IntDirFullpath.StartsWith($(Tmp), true, null))' == 'true' or '$(_IntDirFullpath.StartsWith($(Temp), true, null))' == 'true' or '$(_OutDirFullpath.StartsWith($(Tmp), true, null))' == 'true' or '$(_OutDirFullpath.StartsWith($(Temp), true, null))' == 'true')"/>
VS 版本之间的实现有点不同,但解决方案是一样的。您只需要通过分配一个宏来禁用触发器。
- 打开或创建您的个人属性文件
Microsoft.Cpp.x64.user.props 和
Microsoft.Cpp.Win32.user.props
- 添加宏
IgnoreWarnIntDirInTempDetected,值为true
完成
该解决方案同样适用于 VS2013 和 VS2015。个人属性文件位于:
%LOCALAPPDATA%\Microsoft\MSBuild\v4.0