Skip to content

Commit

Permalink
Enable MSBuild warning for mismatched IntermediateOutputPath if proje…
Browse files Browse the repository at this point in the history
…ct uses PackageReferenc
  • Loading branch information
dsplaisted committed Mar 13, 2018
1 parent 09f1311 commit b0eae2d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/NuGet.Core/NuGet.Build.Tasks/NuGet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,25 @@ Copyright (c) .NET Foundation. All rights reserved.
</PropertyGroup>
</Target>

<!--
============================================================
_GetRestoreProjectStyle
If using PackageReference, enable an MSBuild warning if BaseIntermediateOutputPath is set to something different
than MSBuildProjectExtensionsPath, because it may be unexpected that the assets and related files wouldn't be written
to the BaseIntermediateOutputPath.
============================================================
-->

<Target Name="EnableIntermediateOutputPathMismatchWarning" DependsOnTargets="_GetRestoreProjectStyle"
BeforeTargets="_CheckForInvalidConfigurationAndPlatform"
Condition="'$(RestoreProjectStyle)' == 'PackageReference'">

<PropertyGroup Condition="'$(EnableBaseIntermediateOutputPathMismatchWarning)' == ''">
<EnableBaseIntermediateOutputPathMismatchWarning>true</EnableBaseIntermediateOutputPathMismatchWarning>
</PropertyGroup>

</Target>

<!--
============================================================
_GetRestoreTargetFrameworksOutput
Expand Down

0 comments on commit b0eae2d

Please sign in to comment.