From 228355b4e69e7bd046ed03454a9d0149dcce0f6b Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Wed, 14 Dec 2016 12:25:07 -0800 Subject: [PATCH] Fix race condition writing assembly attribute file MSBuild generates the TargetFrameworkAttribute file to the same path on disk for equivalent combinations of TargetFrameworkIdentifier and TargetProfile. This means if two projects in a solution have equivalent identifiers, their builds will race to write the same file to disk. This is safe by virtue that the content of the file is the same in both cases. Hence it doesn't really matter who wins the race, both projects see the same output. This is frustrating though because even though it's safe, MSBuild still isssue a warning when it happens. This breaks our desire to have warning free builds. To fix this we will instead generate the file to the Obj\ProjectName directory. This means every project gets their own indepnedent copy of the file, eliminating the race. closes #10116 --- build/Targets/Imports.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/build/Targets/Imports.targets b/build/Targets/Imports.targets index 95af4ea8d5d..1f010ff9198 100644 --- a/build/Targets/Imports.targets +++ b/build/Targets/Imports.targets @@ -341,6 +341,7 @@ ==================================================================================== --> + $(IntermediateOutputPath)$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension) $(IntermediateOutputPath)$(TargetFileName).pcbm $(NuGetPackageRoot)\RoslynDependencies.OptimizationData\2.0.0-rc-61101-16\content\OptimizationData $([System.IO.Path]::GetFullPath('$(OptimizationDataFolderPath)\$(TargetName).pgo')) -- GitLab