From 95419383271d581e2de102025c7cfe0a8910ac8d Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Fri, 11 Jan 2019 12:39:35 -0800 Subject: [PATCH] Fix A VS issue The issue here is that the downlevel SDK (2.1/2.2) don't define the component-related targets needed for the component design time build. Depending on the ordering of targets, this can break all features in VS that depend on the design-time build. Since we want this to noop in those cases, the best fix is to make our targets depend on a target property that will be empty in the downlevel SDKS, but will contain our targets in the 3.0 SDK. (cherry picked from commit dotnet/aspnetcore-tooling@b88b32c73ac823febf2319690e5b7ff9f23e9e28) \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/1c4b19ae88c4a4f53671b85f8afb0a6c32c0efbf --- .../Microsoft.NET.Sdk.Razor.DesignTime.targets | 16 +++++++++++++--- .../Sdk.Razor.CurrentVersion.props | 9 +++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.DesignTime.targets b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.DesignTime.targets index a1b33cf7cc..29d5e8ea4c 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.DesignTime.targets +++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.DesignTime.targets @@ -74,16 +74,26 @@ Copyright (c) .NET Foundation. All rights reserved. Returns="@(RazorGenerateWithTargetPath)"> + - + + + DependsOnTargets="$(_RazorGenerateComponentDeclarationDesignTimeDependsOn)"> diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.props b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.props index 71100e6541..aa0a8da485 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.props +++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.props @@ -78,4 +78,13 @@ Copyright (c) .NET Foundation. All rights reserved. + + + <_RazorGenerateComponentDeclarationDesignTimeDependsOn>ResolveRazorConfiguration;ResolveRazorComponentInputs;AssignRazorComponentTargetPaths;RazorGenerateComponentDeclaration + <_RazorGenerateComponentDesignTimeDependsOn>ResolveRazorComponentInputs;AssignRazorComponentTargetPaths + +