From 9365fcd053e60063517b065bb62c328b535993fe Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 11 Apr 2018 14:45:44 -0700 Subject: [PATCH] Don't publish the refs directory when the app does not have any Razor files Fixes https://github.com/aspnet/Razor/issues/2246 --- .../build/netstandard2.0/Sdk.Razor.CurrentVersion.targets | 8 ++++++-- .../IntegrationTests/PublishIntegrationTest.cs | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets b/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets index f6004d8fdf..a20aef15e8 100644 --- a/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets +++ b/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets @@ -492,17 +492,21 @@ Copyright (c) .NET Foundation. All rights reserved. + + - + - diff --git a/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/PublishIntegrationTest.cs b/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/PublishIntegrationTest.cs index 3147d26b51..be6b1fed29 100644 --- a/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/PublishIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/PublishIntegrationTest.cs @@ -142,6 +142,9 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.FileExists(result, PublishOutputPath, "SimpleMvc.pdb"); Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.dll"); Assert.FileDoesNotExist(result, PublishOutputPath, "SimpleMvc.Views.pdb"); + + // By default refs will not be copied on publish + Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "refs"), "*.dll"); } [Fact]