From 8d1de6ec80a6c8c8da93b511e8181cd2fdd29130 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 13 Apr 2018 11:26:22 -0700 Subject: [PATCH] Make sure RazorSdk works when BuildingInVisualStudio \ BuildProjectReferences is disabled Fixes #2247 --- .../Sdk.Razor.CurrentVersion.targets | 15 +++++++- .../IntegrationTests/BuildIntegrationTest.cs | 36 +++++++++++++++++++ .../InitializeTestProjectAttribute.cs | 2 +- .../MSBuildIntegrationTestBase.cs | 7 +++- test/testapps/ClassLibrary2/Class2.cs | 13 +++++++ .../ClassLibrary2/ClassLibrary2.csproj | 27 ++++++++++++++ .../ClassLibrary2/Views/Shared/Index.cshtml | 2 ++ .../ClassLibrary2/Views/_ViewImports.cshtml | 2 ++ 8 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 test/testapps/ClassLibrary2/Class2.cs create mode 100644 test/testapps/ClassLibrary2/ClassLibrary2.csproj create mode 100644 test/testapps/ClassLibrary2/Views/Shared/Index.cshtml create mode 100644 test/testapps/ClassLibrary2/Views/_ViewImports.cshtml 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 a20aef15e8..af1d956b20 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 @@ -69,6 +69,11 @@ Copyright (c) .NET Foundation. All rights reserved. _RazorAddDebugSymbolsProjectOutputGroupOutput + + _RazorPrepareForRun; + $(PrepareForRunDependsOn) + + + + + <_MvcExtensionAssemblyPath>$(SolutionRoot)src\Microsoft.AspNetCore.Mvc.Razor.Extensions\bin\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll + + + + + netstandard2.0 + + + + + + + + + + + diff --git a/test/testapps/ClassLibrary2/Views/Shared/Index.cshtml b/test/testapps/ClassLibrary2/Views/Shared/Index.cshtml new file mode 100644 index 0000000000..415ad5c4f8 --- /dev/null +++ b/test/testapps/ClassLibrary2/Views/Shared/Index.cshtml @@ -0,0 +1,2 @@ +@{ var message = "Hello world";} +@message diff --git a/test/testapps/ClassLibrary2/Views/_ViewImports.cshtml b/test/testapps/ClassLibrary2/Views/_ViewImports.cshtml new file mode 100644 index 0000000000..1dbbe8a4c2 --- /dev/null +++ b/test/testapps/ClassLibrary2/Views/_ViewImports.cshtml @@ -0,0 +1,2 @@ +@using ClassLibrary +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers