Skip to content

Commit

Permalink
Make depproj intermediate output paths unique again
Browse files Browse the repository at this point in the history
Fixes #36255

Depprojs depend on IntermediateOutputPath being set in a props file early enough as restore is happening per configuration. Even though it isn't recommended that the TargetFramework property is read before the project is loaded, we currently encode the TargetFramework in the IntermediateOutputPath for depproj files. The long-term fix is to get rid of per configuration restores by getting rid of our depproj files.
  • Loading branch information
ViktorHofer committed May 14, 2020
1 parent f53c156 commit a474cc3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libraries/restore/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<!-- We need configuration-specific assets files. -->
<!-- We need configuration-specific assets files which requires the IntermeidateOutputPath to be set. -->
<IntermediateOutputPath>$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', '$(TargetFramework)-$(TargetFrameworkSuffix)-$(Configuration)'))</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(TargetFrameworkSuffix)' == ''">$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', '$(TargetFramework)-$(Configuration)'))</IntermediateOutputPath>
<RestoreOutputPath>$(IntermediateOutputPath)</RestoreOutputPath>
<ProjectAssetsFile>$(RestoreOutputPath)/project.assets.json</ProjectAssetsFile>
<MSBuildProjectExtensionsPath>$(IntermediateOutputPath)</MSBuildProjectExtensionsPath>

<SkipDeriveTargetFrameworks>true</SkipDeriveTargetFrameworks>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<AdditionalBuildTargetFrameworks Condition="'$(BuildAllProjects)' == 'true'">netstandard2.0</AdditionalBuildTargetFrameworks>
Expand All @@ -18,4 +21,4 @@
<ExcludeAssets>Build</ExcludeAssets>
</PackageReference>
</ItemDefinitionGroup>
</Project>
</Project>

0 comments on commit a474cc3

Please sign in to comment.