提交 228355b4 编写于 作者: J Jared Parsons

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
上级 85a3caf6
......@@ -341,6 +341,7 @@
==================================================================================== -->
<PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$(IntermediateOutputPath)$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)</TargetFrameworkMonikerAssemblyAttributesPath>
<PostCompileBinaryModificationSentinelFile>$(IntermediateOutputPath)$(TargetFileName).pcbm</PostCompileBinaryModificationSentinelFile>
<OptimizationDataFolderPath>$(NuGetPackageRoot)\RoslynDependencies.OptimizationData\2.0.0-rc-61101-16\content\OptimizationData</OptimizationDataFolderPath>
<OptimizationDataFile>$([System.IO.Path]::GetFullPath('$(OptimizationDataFolderPath)\$(TargetName).pgo'))</OptimizationDataFile>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册