Update samples and tests to target netcoreapp2.1

This commit is contained in:
Pranav K 2017-11-15 11:03:08 -08:00
parent 02850d48dd
commit 7f1a987ada
55 changed files with 125 additions and 82 deletions

View File

@ -1,4 +1,8 @@
<Project> <Project>
<Import
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))\AspNetCoreSettings.props"
Condition=" '$(CI)' != 'true' AND '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))' != '' " />
<Import Project="version.props" /> <Import Project="version.props" />
<Import Project="build\dependencies.props" /> <Import Project="build\dependencies.props" />

View File

@ -4,20 +4,20 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="Package Versions"> <PropertyGroup Label="Package Versions">
<InternalAspNetCoreSdkPackageVersion>2.1.0-preview1-15551</InternalAspNetCoreSdkPackageVersion> <InternalAspNetCoreSdkPackageVersion>2.1.0-preview1-15551</InternalAspNetCoreSdkPackageVersion>
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion> <MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
<MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreHostingPackageVersion> <MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreHostingPackageVersion>
<MicrosoftAspNetCoreMvcPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreMvcPackageVersion> <MicrosoftAspNetCoreMvcPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreMvcPackageVersion>
<MicrosoftAspNetCoreMvcRazorPagesPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreMvcRazorPagesPackageVersion> <MicrosoftAspNetCoreMvcRazorPagesPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreMvcRazorPagesPackageVersion>
<MicrosoftAspNetCoreRazorRuntimePackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreRazorRuntimePackageVersion> <MicrosoftAspNetCoreRazorRuntimePackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreRazorRuntimePackageVersion>
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.5.0-preview1-27498</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion> <MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.5.0-preview1-27498</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreServerKestrelPackageVersion> <MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreServerKestrelPackageVersion>
<MicrosoftAspNetCoreTestingPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreTestingPackageVersion> <MicrosoftAspNetCoreTestingPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreTestingPackageVersion>
<MicrosoftBuildTasksCorePackageVersion>15.3.409</MicrosoftBuildTasksCorePackageVersion> <MicrosoftBuildTasksCorePackageVersion>15.3.409</MicrosoftBuildTasksCorePackageVersion>
<MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion> <MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsConfigurationCommandLinePackageVersion> <MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsLoggingConsolePackageVersion> <MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsLoggingConsolePackageVersion>
<MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsLoggingPackageVersion> <MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsLoggingPackageVersion>
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsLoggingTestingPackageVersion> <MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsLoggingTestingPackageVersion>
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion> <MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
<MicrosoftNETTestSdkPackageVersion>15.3.0</MicrosoftNETTestSdkPackageVersion> <MicrosoftNETTestSdkPackageVersion>15.3.0</MicrosoftNETTestSdkPackageVersion>
<XunitPackageVersion>2.3.0</XunitPackageVersion> <XunitPackageVersion>2.3.0</XunitPackageVersion>

View File

@ -1,2 +1,2 @@
version:2.1.0-preview1-15551 version:2.1.0-preview1-15567
commithash:8fad9553b48533fddbb16a423ea55b9710ea2e63 commithash:903e3104807b1bb8cddd28bdef205b1e2dc021d1

View File

@ -1,6 +1,13 @@
<Project> <Project>
<Import Project="..\Directory.Build.props" /> <Import Project="..\Directory.Build.props" />
<PropertyGroup>
<DeveloperBuildTestTfms>netcoreapp2.1</DeveloperBuildTestTfms>
<StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' ">netcoreapp2.1;netcoreapp2.0</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" /> <PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />

View File

@ -7,6 +7,15 @@ namespace FunctionalTests
{ {
public class CoreCLRApplicationTestFixture<TStartup> : ApplicationTestFixture public class CoreCLRApplicationTestFixture<TStartup> : ApplicationTestFixture
{ {
private const string TargetFramework =
#if NETCOREAPP2_0
"netcoreapp2.0";
#elif NETCOREAPP2_1
"netcoreapp2.1";
#else
#error Target frameworks need to be updated
#endif
public CoreCLRApplicationTestFixture() public CoreCLRApplicationTestFixture()
: this(typeof(TStartup).Assembly.GetName().Name, null) : this(typeof(TStartup).Assembly.GetName().Name, null)
{ {
@ -17,6 +26,6 @@ namespace FunctionalTests
{ {
} }
protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.CoreClr); protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.CoreClr, TargetFramework);
} }
} }

View File

@ -29,10 +29,17 @@ namespace FunctionalTests
var applicationName = nameof(SimpleApp); var applicationName = nameof(SimpleApp);
var applicationPath = ApplicationPaths.GetTestAppDirectory(applicationName); var applicationPath = ApplicationPaths.GetTestAppDirectory(applicationName);
var deploymentParameters = ApplicationTestFixture.GetDeploymentParameters( var deploymentParameters = ApplicationTestFixture.GetDeploymentParameters(
applicationPath, applicationPath,
applicationName, applicationName,
RuntimeFlavor.CoreClr); RuntimeFlavor.CoreClr,
#if NETCOREAPP2_0
"netcoreapp2.0");
#elif NETCOREAPP2_1
"netcoreapp2.1");
#else
#error Target frameworks need to be updated
#endif
// Deploy for a rid that does not exist on the current platform. // Deploy for a rid that does not exist on the current platform.
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{ {
@ -49,7 +56,7 @@ namespace FunctionalTests
// Act // Act
var expectedFile = Path.Combine( var expectedFile = Path.Combine(
deploymentParameters.PublishedApplicationRootPath, deploymentParameters.PublishedApplicationRootPath,
$"{applicationName}.PrecompiledViews.dll"); $"{applicationName}.PrecompiledViews.dll");
Assert.True(File.Exists(expectedFile), $"Expected precompiled file {expectedFile} does not exist."); Assert.True(File.Exists(expectedFile), $"Expected precompiled file {expectedFile} does not exist.");
} }
@ -57,7 +64,7 @@ namespace FunctionalTests
private class DotNetPublishDeployer : ApplicationDeployer private class DotNetPublishDeployer : ApplicationDeployer
{ {
public DotNetPublishDeployer(DeploymentParameters deploymentParameters, ILoggerFactory loggerFactory) public DotNetPublishDeployer(DeploymentParameters deploymentParameters, ILoggerFactory loggerFactory)
: base(deploymentParameters, loggerFactory) : base(deploymentParameters, loggerFactory)
{ {
} }

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Logging.Testing;
@ -30,18 +31,19 @@ namespace FunctionalTests
// Arrange // Arrange
var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); var deployment = await Fixture.CreateDeploymentAsync(loggerFactory);
// Act
var response = await deployment.HttpClient.GetStringWithRetryAsync(
deployment.ApplicationBaseUri,
loggerFactory.CreateLogger(Fixture.ApplicationName));
// Assert // Assert
TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); var expected = Path.Combine(deployment.ContentRoot, $"{Fixture.ApplicationName}.PrecompiledViews.dll");
Assert.True(File.Exists(expected), $"File {expected} does not exist.");
} }
} }
public class TestFixture : CoreCLRApplicationTestFixture<SimpleApp.Startup> public class TestFixture : CoreCLRApplicationTestFixture<SimpleApp.Startup>
{ {
public TestFixture()
{
PublishOnly = true;
}
protected override DeploymentParameters GetDeploymentParameters() protected override DeploymentParameters GetDeploymentParameters()
{ {
var deploymentParameters = base.GetDeploymentParameters(); var deploymentParameters = base.GetDeploymentParameters();

View File

@ -17,6 +17,6 @@ namespace FunctionalTests
{ {
} }
protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.Clr); protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.Clr, "net461");
} }
} }

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Testing.xunit; using Microsoft.AspNetCore.Testing.xunit;
@ -26,6 +27,7 @@ namespace FunctionalTests
public ApplicationTestFixture Fixture { get; } public ApplicationTestFixture Fixture { get; }
[ConditionalFact] [ConditionalFact]
[Fact]
public async Task PublishingInDebugWorks() public async Task PublishingInDebugWorks()
{ {
using (StartLog(out var loggerFactory)) using (StartLog(out var loggerFactory))
@ -33,18 +35,19 @@ namespace FunctionalTests
// Arrange // Arrange
var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); var deployment = await Fixture.CreateDeploymentAsync(loggerFactory);
// Act
var response = await deployment.HttpClient.GetStringWithRetryAsync(
deployment.ApplicationBaseUri,
loggerFactory.CreateLogger(Fixture.ApplicationName));
// Assert // Assert
TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); var expected = Path.Combine(deployment.ContentRoot, $"{Fixture.ApplicationName}.PrecompiledViews.dll");
Assert.True(File.Exists(expected), $"File {expected} does not exist.");
} }
} }
public class TestFixture : DesktopApplicationTestFixture<SimpleApp.Startup> public class TestFixture : CoreCLRApplicationTestFixture<SimpleApp.Startup>
{ {
public TestFixture()
{
PublishOnly = true;
}
protected override DeploymentParameters GetDeploymentParameters() protected override DeploymentParameters GetDeploymentParameters()
{ {
var deploymentParameters = base.GetDeploymentParameters(); var deploymentParameters = base.GetDeploymentParameters();

View File

@ -1,15 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework> <TargetFrameworks>netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(DeveloperBuild)'!='true'">$(TargetFrameworks);netcoreapp2.0</TargetFrameworks>
<DefineConstants>$(DefineConstants);__remove_this_to__GENERATE_BASELINES</DefineConstants> <DefineConstants>$(DefineConstants);__remove_this_to__GENERATE_BASELINES</DefineConstants>
<DefineConstants Condition="'$(GenerateBaseLines)'=='true'">$(DefineConstants);GENERATE_BASELINES</DefineConstants> <DefineConstants Condition="'$(GenerateBaseLines)'=='true'">$(DefineConstants);GENERATE_BASELINES</DefineConstants>
<SignAssembly>false</SignAssembly> <SignAssembly>false</SignAssembly>
<PublicSign>false</PublicSign> <PublicSign>false</PublicSign>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Resources\*" /> <EmbeddedResource Include="Resources\*" />
<Compile Include="Infrastructure\*.cs" />
<Compile Include="DesktopTests\*.cs" Condition="'$(TargetFramework)'=='net461'" />
<Compile Include="CoreCLRTests\*.cs" Condition="'$(TargetFramework)'=='netcoreapp2.0' OR '$(TargetFramework)'=='netcoreapp2.1'" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -3,6 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -12,7 +13,7 @@ namespace FunctionalTests
public abstract class ApplicationTestFixture : IDisposable public abstract class ApplicationTestFixture : IDisposable
{ {
private const string DotnetCLITelemetryOptOut = "DOTNET_CLI_TELEMETRY_OPTOUT"; private const string DotnetCLITelemetryOptOut = "DOTNET_CLI_TELEMETRY_OPTOUT";
private readonly object _deploymentLock = new object(); private static readonly SemaphoreSlim _deploymentLock = new SemaphoreSlim(initialCount: 1);
private Task<DeploymentResult> _deploymentTask; private Task<DeploymentResult> _deploymentTask;
private IApplicationDeployer _deployer; private IApplicationDeployer _deployer;
@ -30,14 +31,20 @@ namespace FunctionalTests
protected abstract DeploymentParameters GetDeploymentParameters(); protected abstract DeploymentParameters GetDeploymentParameters();
protected DeploymentParameters GetDeploymentParameters(RuntimeFlavor flavor) protected DeploymentParameters GetDeploymentParameters(RuntimeFlavor flavor, string targetFramework)
=> GetDeploymentParameters(ApplicationPath, ApplicationName, flavor); => GetDeploymentParameters(ApplicationPath, ApplicationName, flavor, targetFramework);
public static DeploymentParameters GetDeploymentParameters(string applicationPath, string applicationName, RuntimeFlavor flavor) public static DeploymentParameters GetDeploymentParameters(string applicationPath, string applicationName, RuntimeFlavor flavor, string targetFramework)
{ {
var telemetryOptOut = new KeyValuePair<string, string>( // This determines the configuration of the the test project and consequently the configuration the src projects are most likely built in.
DotnetCLITelemetryOptOut, var projectConfiguration =
"1"); #if DEBUG
"Debug";
#elif RELEASE
"Release";
#else
#error Unknown configuration
#endif
var deploymentParameters = new DeploymentParameters( var deploymentParameters = new DeploymentParameters(
applicationPath, applicationPath,
@ -47,16 +54,18 @@ namespace FunctionalTests
{ {
ApplicationName = applicationName, ApplicationName = applicationName,
PublishApplicationBeforeDeployment = true, PublishApplicationBeforeDeployment = true,
TargetFramework = flavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
Configuration = "Release", Configuration = "Release",
EnvironmentVariables = EnvironmentVariables =
{ {
telemetryOptOut, new KeyValuePair<string, string>(DotnetCLITelemetryOptOut, "1"),
new KeyValuePair<string, string>("SolutionConfiguration", projectConfiguration),
}, },
PublishEnvironmentVariables = PublishEnvironmentVariables =
{ {
telemetryOptOut, new KeyValuePair<string, string>(DotnetCLITelemetryOptOut, "1"),
new KeyValuePair<string, string>("SolutionConfiguration", projectConfiguration),
}, },
TargetFramework = targetFramework,
}; };
return deploymentParameters; return deploymentParameters;
@ -74,8 +83,9 @@ namespace FunctionalTests
public async Task<DeploymentResult> CreateDeploymentAsync(ILoggerFactory loggerFactory) public async Task<DeploymentResult> CreateDeploymentAsync(ILoggerFactory loggerFactory)
{ {
lock (_deploymentLock) try
{ {
await _deploymentLock.WaitAsync(TimeSpan.FromSeconds(10));
if (_deploymentTask == null) if (_deploymentTask == null)
{ {
var deploymentParameters = GetDeploymentParameters(); var deploymentParameters = GetDeploymentParameters();
@ -91,6 +101,10 @@ namespace FunctionalTests
_deploymentTask = _deployer.DeployAsync(); _deploymentTask = _deployer.DeployAsync();
} }
} }
finally
{
_deploymentLock.Release();
}
return await _deploymentTask; return await _deploymentTask;
} }

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<ClassLibraryProjectPath>..\ClassLibraryWithPrecompiledViews\ClassLibraryWithPrecompiledViews.csproj</ClassLibraryProjectPath> <ClassLibraryProjectPath>..\ClassLibraryWithPrecompiledViews\ClassLibraryWithPrecompiledViews.csproj</ClassLibraryProjectPath>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
<DefineConstants>$(DefineConstants);TEST123</DefineConstants> <DefineConstants>$(DefineConstants);TEST123</DefineConstants>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
<MvcRazorEmbedViewSources>true</MvcRazorEmbedViewSources> <MvcRazorEmbedViewSources>true</MvcRazorEmbedViewSources>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks> <TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorOutputPath Condition="'$(TargetFramework)'!=''">obj\precompiled\$(TargetFramework)</MvcRazorOutputPath> <MvcRazorOutputPath Condition="'$(TargetFramework)'!=''">obj\precompiled\$(TargetFramework)</MvcRazorOutputPath>
<TestIncludeViewCompilationTargets>true</TestIncludeViewCompilationTargets> <TestIncludeViewCompilationTargets>true</TestIncludeViewCompilationTargets>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcPackageVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,6 +1,13 @@
<Project> <Project>
<Import Project="..\Directory.Build.props" /> <Import Project="..\Directory.Build.props" />
<PropertyGroup>
<DeveloperBuildTestAppTfms>netcoreapp2.1</DeveloperBuildTestAppTfms>
<StandardTestAppTfms>$(DeveloperBuildTestAppTfms)</StandardTestAppTfms>
<StandardTestAppTfms Condition=" '$(DeveloperBuild)' != 'true' ">netcoreapp2.1;netcoreapp2.0</StandardTestAppTfms>
<StandardTestAppTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestAppTfms);net461</StandardTestAppTfms>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<!-- Override some repo-level properties not required for tests. --> <!-- Override some repo-level properties not required for tests. -->
<Version>1.0.0</Version> <Version>1.0.0</Version>

View File

@ -4,23 +4,20 @@
<PropertyGroup> <PropertyGroup>
<_MvcViewCompilationAddDesktopReferences>false</_MvcViewCompilationAddDesktopReferences> <_MvcViewCompilationAddDesktopReferences>false</_MvcViewCompilationAddDesktopReferences>
<TestIncludeViewCompilationTargets Condition="'$(TestIncludeViewCompilationTargets)'==''">$(MvcRazorCompileOnPublish)</TestIncludeViewCompilationTargets> <TestIncludeViewCompilationTargets Condition="'$(TestIncludeViewCompilationTargets)'==''">$(MvcRazorCompileOnPublish)</TestIncludeViewCompilationTargets>
<_MvcViewCompilationTasksPath>$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\bin\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll</_MvcViewCompilationTasksPath> <SolutionConfiguration Condition="'$(SolutionConfiguration)'==''">$(Configuration)</SolutionConfiguration>
<_MvcViewCompilationTasksPath>$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\bin\$(SolutionConfiguration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll</_MvcViewCompilationTasksPath>
</PropertyGroup> </PropertyGroup>
<Import Project="..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets" <Import Project="..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets"
Condition="'$(TestIncludeViewCompilationTargets)'=='true'"/> Condition="'$(TestIncludeViewCompilationTargets)'=='true'"/>
<ItemGroup Condition="'$(TestIncludeViewCompilationTargets)'=='true'">
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj" />
</ItemGroup>
<Target <Target
Name="SetMvcRazorViewCompilationBinaryPath" Name="SetMvcRazorViewCompilationBinaryPath"
BeforeTargets="MvcRazorPrecompile" BeforeTargets="MvcRazorPrecompile"
Condition="'$(TestIncludeViewCompilationTargets)'=='true'"> Condition="'$(TestIncludeViewCompilationTargets)'=='true'">
<PropertyGroup> <PropertyGroup>
<_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(MSBuildProjectDirectory)\$(OutputPath)Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll</_MvcViewCompilationBinaryPath> <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'!='net461'">$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\bin\$(SolutionConfiguration)\netcoreapp2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll</_MvcViewCompilationBinaryPath>
<_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='net461'">$(MSBuildProjectDirectory)\$(OutputPath)Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe</_MvcViewCompilationBinaryPath> <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='net461'">$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\bin\$(SolutionConfiguration)\net461\win7-x86\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe</_MvcViewCompilationBinaryPath>
</PropertyGroup> </PropertyGroup>
</Target> </Target>
</Project> </Project>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
<MvcRazorEmbedViewSources>true</MvcRazorEmbedViewSources> <MvcRazorEmbedViewSources>true</MvcRazorEmbedViewSources>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<RuntimeIdentifiers>win7-x86;debian-x64</RuntimeIdentifiers> <RuntimeIdentifiers>win7-x86;debian-x64</RuntimeIdentifiers>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup> </PropertyGroup>

View File

@ -2,8 +2,7 @@
<PropertyGroup> <PropertyGroup>
<AssemblyName>NewAssemblyName</AssemblyName> <AssemblyName>NewAssemblyName</AssemblyName>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks> <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<SignAssembly>true</SignAssembly> <SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>