You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building my project, I'm getting a warning from MSBuild saying:
MSB8028: The intermediate directory (<intermediate directory here>) contains files shared from another project (<project name here>)
What's interesting is the shared project name is the exact same as the project I'm currently building. Upon investigation into the folder it complains about, I noticed MSBuild is sometimes creating multiple tlog folders. Since the name of my project is long, the folder hierarchy looks something like this:
Note that MyProjectNameIsL is not a typo, it is to exemplify the length of my project's name and why MSBuild appears to serialize it. For the purpose of this question the name of the project is MyProjectNameIsLong.
If I delete these folders, it works fine for the first build but reports a warning for the second. It appears that MSBuild forgets about the existence of the original tlog folder and just creates a new one. Why is this the case?
The text was updated successfully, but these errors were encountered:
This message comes from the C++ targets. On my machine it's from c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets:
<!-- lastbuildstate is a unique file writen to by each build. Multiple of this file can mean that the IntDir is shared by more the one project. -->
<ItemGroup>
<AllTlogLocationInclude="$(IntDir)*.tlog\*.lastbuildstate"Exclude="$(LastBuildState)"Condition="'$(IntDirSharingDetected)' == ''"/>
</ItemGroup>
<PropertyGroup>
<IntDirSharingDetectedCondition="'@(AllTlogLocation)' != ''">true</IntDirSharingDetected>
<IntDirSharingProjectsCondition="'@(AllTlogLocation)' != ''">@(AllTlogLocation->'%(Filename).vcxproj', ', ')</IntDirSharingProjects>
</PropertyGroup>
<VCMessageCode="MSB8028"Type="Warning"Arguments="$(IntDirSharingProjects);$(IntDir)"Condition="'$(IgnoreWarnIntDirSharingDetected)' != 'true' and '$(IntDirSharingDetected)' == 'true'"/>
LastBuildState is written to TLogLocation, which is defined in C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.BuildSteps.Targets:
<!-- TLogLocation requires trailing slash. -->
<TLogLocationCondition="'$(TLogLocation)' == '' and '$(ProjectName)' != '' and '$(ProjectGuid)' != '' and '$(ProjectName.Length)' > '16'">$(IntDir)$(ProjectName.Substring(0,8)).$(ProjectGuid.Substring(1,8)).tlog\</TLogLocation>
<TLogLocationCondition="'$(TLogLocation)' == ''">$(IntDir)$(ProjectName).tlog\</TLogLocation>
That explains the truncated names and the numbers. Do you perhaps have multiple projects with the same name prefix and different project GUIDs?
The C++ targets aren't open source and are supported by the C++ team, not the MSBuild team that works in this repo, so the best thing to do would be to use their support channels. But the IgnoreWarnIntDirSharingDetected property looks interesting . . .
When building my project, I'm getting a warning from MSBuild saying:
What's interesting is the shared project name is the exact same as the project I'm currently building. Upon investigation into the folder it complains about, I noticed MSBuild is sometimes creating multiple tlog folders. Since the name of my project is long, the folder hierarchy looks something like this:
Note that MyProjectNameIsL is not a typo, it is to exemplify the length of my project's name and why MSBuild appears to serialize it. For the purpose of this question the name of the project is MyProjectNameIsLong.
If I delete these folders, it works fine for the first build but reports a warning for the second. It appears that MSBuild forgets about the existence of the original tlog folder and just creates a new one. Why is this the case?
The text was updated successfully, but these errors were encountered: