From 98a2a4348b79ea094402f3e2a9fbef308c26fedc Mon Sep 17 00:00:00 2001 From: Alex Lorimer Date: Mon, 20 May 2019 14:39:51 +0100 Subject: [PATCH] fixed destructive property assignment (reference self correctly using `$(GetCopyToOutputDirectoryItemsDependsOn)` instead of `$(GetCopyToOutputDirectoryItems)`) (dotnet/aspnetcore-tooling#603) The intention here would have been to add to the existing GetCopyToOutputDirectoryItemsDependsOn property, defined in Microsoft.Common.Targets. Instead what was happening is that it was being completely overwitten with the _RazorGetCopyToOutputDirectoryItems entry, given that $(GetCopyToOutputDirectoryItems) doesn't exist as a property and must have been a typo (it exists as a task, not a property). An effect of this bug was that the `AssignTargetPaths` target is not always executed before the `GetCopyToOutputDirectoryItems` target, which should explicitly depend on it. `AssignTargetPaths` is responsible for populating the `ContentWithTargetPath` itemgroup. Left empty, it appears to `GetCopyToOutputDirectoryItems` task that there are no Content files to copy to the final output directory, when in fact there are.\n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/4597bc3d55e3f88329dd9e55caa774db7fd9de57 --- .../src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets index 0a4d6a4a62..9d84607322 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets +++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets @@ -151,7 +151,7 @@ Copyright (c) .NET Foundation. All rights reserved. _RazorGetCopyToOutputDirectoryItems; - $(GetCopyToOutputDirectoryItems) + $(GetCopyToOutputDirectoryItemsDependsOn)