Add a test using 2.2 project with current Sdk (dotnet/aspnetcore-tooling#91)

* Add a test using 2.2 project with current Sdk

Fixes https://github.com/aspnet/AspNetCore/issues/5101

* Do not reference Microsoft.AspNetCore.App in test apps
\n\nCommit migrated from 9b4fd448d4
This commit is contained in:
Pranav K 2019-01-04 10:36:41 -08:00 committed by GitHub
parent 07a62871d0
commit 49dfd7dacc
22 changed files with 447 additions and 60 deletions

View File

@ -615,22 +615,6 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.Equal(firstAssemblyBytes, secondAssemblyBytes);
}
[Fact]
[InitializeTestProject("SimpleMvc21")]
public async Task Building_NETCoreApp21TargetingProject()
{
TargetFramework = "netcoreapp2.1";
// 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");
}
[Fact]
[InitializeTestProject("SimpleMvc21")]
public async Task Building_WorksWhenMultipleRazorConfigurationsArePresent()

View File

@ -0,0 +1,32 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
public class BuildIntegrationTest21 : MSBuildIntegrationTestBase, IClassFixture<LegacyBuildServerTestFixture>
{
public BuildIntegrationTest21(LegacyBuildServerTestFixture buildServer)
: base(buildServer)
{
}
[Fact]
[InitializeTestProject("SimpleMvc21")]
public async Task Building_NETCoreApp21TargetingProject()
{
TargetFramework = "netcoreapp2.1";
// 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");
}
}
}

View File

@ -0,0 +1,32 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
public class BuildIntegrationTest22 : MSBuildIntegrationTestBase, IClassFixture<LegacyBuildServerTestFixture>
{
public BuildIntegrationTest22(LegacyBuildServerTestFixture buildServer)
: base(buildServer)
{
}
[Fact]
[InitializeTestProject("SimpleMvc22")]
public async Task Building_NETCoreApp22TargetingProject()
{
TargetFramework = "netcoreapp2.2";
// Build
var result = await DotnetMSBuild("Build");
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "SimpleMvc22.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc22.pdb");
Assert.FileExists(result, OutputPath, "SimpleMvc22.Views.dll");
Assert.FileExists(result, OutputPath, "SimpleMvc22.Views.pdb");
}
}
}

View File

@ -2,60 +2,27 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using System.Threading;
using Microsoft.AspNetCore.Razor.Tools;
using Microsoft.CodeAnalysis;
using Moq;
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
public class BuildServerTestFixture : IDisposable
/// <summary>
/// A test fixture that initializes a server as part of it's ctor.
/// Note that this fixture will always initialize a server of the current version since it
/// invokes the ServerConnection API from the referenced rzc.
/// </summary>
public class BuildServerTestFixture : BuildServerTestFixtureBase, IDisposable
{
private static readonly TimeSpan _defaultShutdownTimeout = TimeSpan.FromSeconds(60);
public BuildServerTestFixture() : this(Guid.NewGuid().ToString())
{
}
internal BuildServerTestFixture(string pipeName)
: base(pipeName)
{
PipeName = pipeName;
if (!ServerConnection.TryCreateServerCore(Environment.CurrentDirectory, PipeName, out var processId))
if (!ServerConnection.TryCreateServerCore(Environment.CurrentDirectory, pipeName, out _))
{
throw new InvalidOperationException($"Failed to start the build server at pipe {PipeName}.");
}
ProcessId = processId;
}
public string PipeName { get; }
public int? ProcessId { get; }
public void Dispose()
{
// Shutdown the build server.
using (var cts = new CancellationTokenSource(_defaultShutdownTimeout))
{
var writer = new StringWriter();
cts.Token.Register(() =>
{
var output = writer.ToString();
throw new TimeoutException($"Shutting down the build server at pipe {PipeName} took longer than expected.{Environment.NewLine}Output: {output}.");
});
var application = new Application(cts.Token, Mock.Of<ExtensionAssemblyLoader>(), Mock.Of<ExtensionDependencyChecker>(), (path, properties) => Mock.Of<PortableExecutableReference>(), writer, writer);
var exitCode = application.Execute("shutdown", "-w", "-p", PipeName);
if (exitCode != 0)
{
var output = writer.ToString();
throw new InvalidOperationException(
$"Build server at pipe {PipeName} failed to shutdown with exit code {exitCode}. Output: {output}");
}
throw new InvalidOperationException($"Failed to start the build server at pipe {pipeName}.");
}
}
}

View File

@ -0,0 +1,66 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.AspNetCore.Razor.Tools;
using Microsoft.CodeAnalysis;
using Moq;
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
public abstract class BuildServerTestFixtureBase : IDisposable
{
private static readonly TimeSpan _defaultShutdownTimeout = TimeSpan.FromSeconds(60);
protected BuildServerTestFixtureBase(string pipeName)
{
PipeName = pipeName;
}
public string PipeName { get; }
public void Dispose()
{
// Shutdown the build server.
using (var cts = new CancellationTokenSource(_defaultShutdownTimeout))
{
var writer = new StringWriter();
cts.Token.Register(() =>
{
var output = writer.ToString();
throw new TimeoutException($"Shutting down the build server at pipe {PipeName} took longer than expected.{Environment.NewLine}Output: {output}.");
});
var application = new Application(cts.Token, Mock.Of<ExtensionAssemblyLoader>(), Mock.Of<ExtensionDependencyChecker>(), (path, properties) => Mock.Of<PortableExecutableReference>(), writer, writer);
var args = new List<string>
{
"shutdown",
"-p",
PipeName,
};
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
// Workaround for https://github.com/dotnet/corefx/issues/31713. On Linux, the server shuts down but hangs around as defunct process
// We'll send a shutdown request but not wait for it.
args.Add("-w");
}
var exitCode = application.Execute(args.ToArray());
if (exitCode != 0)
{
var output = writer.ToString();
throw new InvalidOperationException(
$"Build server at pipe {PipeName} failed to shutdown with exit code {exitCode}. Output: {output}");
}
}
}
}
}

View File

@ -0,0 +1,18 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
/// <summary>
/// A fixture that relies on the build task to spin up the build server.
/// </summary>
public class LegacyBuildServerTestFixture : BuildServerTestFixtureBase
{
public LegacyBuildServerTestFixture()
: base(Guid.NewGuid().ToString())
{
}
}
}

View File

@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
private static readonly AsyncLocal<ProjectDirectory> _project = new AsyncLocal<ProjectDirectory>();
private static readonly AsyncLocal<string> _projectTfm = new AsyncLocal<string>();
protected MSBuildIntegrationTestBase(BuildServerTestFixture buildServer)
protected MSBuildIntegrationTestBase(BuildServerTestFixtureBase buildServer)
{
BuildServer = buildServer;
}
@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
set => _projectTfm.Value = value;
}
protected BuildServerTestFixture BuildServer { get; set; }
protected BuildServerTestFixtureBase BuildServer { get; set; }
internal Task<MSBuildResult> DotnetMSBuild(
string target,

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup>
@ -16,6 +17,7 @@
<!-- Test Placeholder -->
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" IsImplicitlyDefined="true" />
<ProjectReference Include="..\ClassLibrary\ClassLibrary.csproj"/>
</ItemGroup>

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup>
@ -13,6 +14,10 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup>
@ -13,6 +14,10 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup>
@ -13,6 +14,10 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>

View File

@ -0,0 +1,11 @@
using System;
namespace SimpleMvc.Models
{
public class ErrorViewModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}

View File

@ -0,0 +1,13 @@

namespace SimpleMvc
{
public class Program
{
public static void Main(string[] args)
{
// Just make sure we have a reference to the MVC 2.2
var t = typeof(Microsoft.AspNetCore.Mvc.IActionResult);
System.Console.WriteLine(t.FullName);
}
}
}

View File

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<!--
This project references a shipped version of MVC. It will reference the local build of Tasks but not the compiler or any test shims.
-->
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<!-- Test Placeholder -->
<PropertyGroup Condition="'$(RunningAsTest)' == ''">
<!-- We don't want to run build server when not running as tests. -->
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,7 @@
@{
ViewData["Title"] = "About";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<p>Use this area to provide additional information.</p>

View File

@ -0,0 +1,108 @@
@{
ViewData["Title"] = "Home Page";
}
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
Learn how to build ASP.NET apps that can run anywhere.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
<div class="item">
<img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
There are powerful new features in Visual Studio for building modern web apps.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
<div class="item">
<img src="~/images/banner3.svg" alt="Package Management" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
Bring in libraries from NuGet, Bower, and npm, and automate tasks using Grunt or Gulp.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
<div class="item">
<img src="~/images/banner4.svg" alt="Microsoft Azure" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="row">
<div class="col-md-3">
<h2>Application uses</h2>
<ul>
<li>Sample pages using ASP.NET Core MVC</li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li>
<li>Theming using <a href="https://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>How to</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>Overview</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>Run &amp; Deploy</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li>
</ul>
</div>
</div>

View File

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - SimpleMvc</title>
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/css/site.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
</environment>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">SimpleMvc</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>&copy; 2017 - SimpleMvc</p>
</footer>
</div>
<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
</environment>
<environment exclude="Development">
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
crossorigin="anonymous"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
</environment>
@RenderSection("Scripts", required: false)
</body>
</html>

View File

@ -0,0 +1,18 @@
<environment include="Development">
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment exclude="Development">
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator"
crossorigin="anonymous"
integrity="sha384-Fnqn3nxp3506LP/7Y3j/25BlWeA3PXTyT1l78LjECcPaKCV12TsZP7yyMxOe/G/k">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js"
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
crossorigin="anonymous"
integrity="sha384-JrXK+k53HACyavUKOsL+NkmSesD2P+73eDMrbTtTk0h4RmOF8hF8apPlkp26JlyH">
</script>
</environment>

View File

@ -0,0 +1,4 @@
@using SimpleMvc
@using SimpleMvc.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@namespace SimpleMvc21

View File

@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup>
@ -18,6 +19,10 @@
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup>
@ -13,6 +14,10 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>