Visual Studio每次编译都会抱怨
warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build.
我正在检查项目并更改输出目录和中间目录,但我仍然在我的解决方案中获得了每个项目的消息。
我该如何解决这个问题?
答案 0 :(得分:3)
我找到了答案 - 我缺少环境变量。添加它们并重新启动后问题就消失了。
如何修复Windows 7
答案 1 :(得分:0)
这是一个真正无用的信息警告。我认为将所有中间文件定向到临时文件夹是一个很好的主意。至少在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
答案 2 :(得分:0)
对于那些使用VS 2019(可能还有后者)遇到此问题的人。
(与TEMP环境变量无关)。
VS 2019不支持用户设置,您应该使用项目设置来禁用警告。
知道MSBuild也会从环境评估属性,因此可以定义与MSBuild属性同名的环境变量。在您要禁用警告的会话中创建以下属性
set IgnoreWarnIntDirInTempDetected=true
然后开始构建。