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 e88bf7a92a..d6ba1853aa 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
@@ -276,10 +276,10 @@ Copyright (c) .NET Foundation. All rights reserved.
Condition="'$(RazorDefaultConfiguration)'!=''">
-
+
-
+
diff --git a/test/Microsoft.NET.Sdk.Razor.Test/IntegrationTests/BuildIntegrationTest.cs b/test/Microsoft.NET.Sdk.Razor.Test/IntegrationTests/BuildIntegrationTest.cs
index 82ce3bc10f..c4e342c43d 100644
--- a/test/Microsoft.NET.Sdk.Razor.Test/IntegrationTests/BuildIntegrationTest.cs
+++ b/test/Microsoft.NET.Sdk.Razor.Test/IntegrationTests/BuildIntegrationTest.cs
@@ -630,6 +630,28 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.FileExists(result, OutputPath, "SimpleMvc21.Views.pdb");
}
+ [Fact]
+ [InitializeTestProject("SimpleMvc21")]
+ public async Task Building_WorksWhenMultipleRazorConfigurationsArePresent()
+ {
+ TargetFramework = "netcoreapp2.1";
+ AddProjectFileContent(@"
+
+
+ MVC-2.1;$(CustomRazorExtension)
+
+");
+
+ // Build
+ var result = await DotnetMSBuild("Build");
+
+ Assert.BuildPassed(result);
+ Assert.FileExists(result, OutputPath, "SimpleMvc21.dll");
+ Assert.FileExists(result, OutputPath, "SimpleMvc21.pdb");
+ Assert.FileExists(result, OutputPath, "SimpleMvc21.Views.dll");
+ Assert.FileExists(result, OutputPath, "SimpleMvc21.Views.pdb");
+ }
+
private static DependencyContext ReadDependencyContext(string depsFilePath)
{
var reader = new DependencyContextJsonReader();
diff --git a/test/testapps/SimpleMvc21/SimpleMvc21.csproj b/test/testapps/SimpleMvc21/SimpleMvc21.csproj
index c7ab69a68d..2f53950aa6 100644
--- a/test/testapps/SimpleMvc21/SimpleMvc21.csproj
+++ b/test/testapps/SimpleMvc21/SimpleMvc21.csproj
@@ -9,6 +9,8 @@
netcoreapp2.1
+
+
false
diff --git a/test/testapps/SimpleMvc21/Views/_ViewImports.cshtml b/test/testapps/SimpleMvc21/Views/_ViewImports.cshtml
index da00289ea5..477d4ba603 100644
--- a/test/testapps/SimpleMvc21/Views/_ViewImports.cshtml
+++ b/test/testapps/SimpleMvc21/Views/_ViewImports.cshtml
@@ -1,3 +1,4 @@
@using SimpleMvc
@using SimpleMvc.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@namespace SimpleMvc21