From 3c3d6998040e2c148414b29633349b6d7bbcd79b Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 4 Dec 2018 12:14:59 -0800 Subject: [PATCH] Only add DotNetCoreRazorConfiguration capability in SDK for netcoreapp3.0. - Prior to this we were unconditionally adding the `DotNetCoreRazorConfiguration` capability resulting in 1.0 projects looking like 2.1+ projects. - Added a project capability test that verifies we're maintaining project capabilities for netcoreapp3.0 projects. - Added a project capability test that verifies we don't muck with 1.1 project capabilities. aspnet/Razordotnet/aspnetcore-tooling#2751 \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/8d733ecc0422a56ae8dfc7dd296d475bb8b3d790 --- ...Microsoft.NET.Sdk.Razor.DesignTime.targets | 2 +- .../BuildIntrospectionTest.cs | 22 ++++ .../RazorTest.Introspection.targets | 4 + .../test/testassets/SimpleMvc11/Program.cs | 13 +++ .../testassets/SimpleMvc11/SimpleMvc11.csproj | 23 ++++ .../SimpleMvc11/Views/Home/Index.cshtml | 108 ++++++++++++++++++ .../SimpleMvc11/Views/Shared/_Layout.cshtml | 71 ++++++++++++ .../SimpleMvc11/Views/_ViewImports.cshtml | 2 + .../SimpleMvc11/Views/_ViewStart.cshtml | 3 + 9 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 src/Razor/test/testassets/SimpleMvc11/Program.cs create mode 100644 src/Razor/test/testassets/SimpleMvc11/SimpleMvc11.csproj create mode 100644 src/Razor/test/testassets/SimpleMvc11/Views/Home/Index.cshtml create mode 100644 src/Razor/test/testassets/SimpleMvc11/Views/Shared/_Layout.cshtml create mode 100644 src/Razor/test/testassets/SimpleMvc11/Views/_ViewImports.cshtml create mode 100644 src/Razor/test/testassets/SimpleMvc11/Views/_ViewStart.cshtml 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 6df58f657e..cfb0e4e046 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 @@ -26,7 +26,7 @@ Copyright (c) .NET Foundation. All rights reserved. Defines the ability to understand the configuration for the Razor language service provided by the runtime/toolset packages. Introduced in 2.1 --> - + + + + + netcoreapp1.1 + + + + + + + + + All + + + + diff --git a/src/Razor/test/testassets/SimpleMvc11/Views/Home/Index.cshtml b/src/Razor/test/testassets/SimpleMvc11/Views/Home/Index.cshtml new file mode 100644 index 0000000000..00afab6a0c --- /dev/null +++ b/src/Razor/test/testassets/SimpleMvc11/Views/Home/Index.cshtml @@ -0,0 +1,108 @@ +@{ + ViewData["Title"] = "Home Page"; +} + + + + diff --git a/src/Razor/test/testassets/SimpleMvc11/Views/Shared/_Layout.cshtml b/src/Razor/test/testassets/SimpleMvc11/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000000..2172e5e566 --- /dev/null +++ b/src/Razor/test/testassets/SimpleMvc11/Views/Shared/_Layout.cshtml @@ -0,0 +1,71 @@ + + + + + + @ViewData["Title"] - SimpleMvc11 + + + + + + + + + + + + +
+ @RenderBody() +
+
+

© 2018 - SimpleMvc11

+
+
+ + + + + + + + + + + + + @RenderSection("Scripts", required: false) + + diff --git a/src/Razor/test/testassets/SimpleMvc11/Views/_ViewImports.cshtml b/src/Razor/test/testassets/SimpleMvc11/Views/_ViewImports.cshtml new file mode 100644 index 0000000000..ab07b6cfbc --- /dev/null +++ b/src/Razor/test/testassets/SimpleMvc11/Views/_ViewImports.cshtml @@ -0,0 +1,2 @@ +@using SimpleMvc11 +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/Razor/test/testassets/SimpleMvc11/Views/_ViewStart.cshtml b/src/Razor/test/testassets/SimpleMvc11/Views/_ViewStart.cshtml new file mode 100644 index 0000000000..a5f10045db --- /dev/null +++ b/src/Razor/test/testassets/SimpleMvc11/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +}