Update samples and tests to target netcoreapp2.1

This commit is contained in:
Pranav K 2017-11-16 13:59:38 -08:00
parent 5b6db93383
commit 186e9806cd
10 changed files with 22 additions and 16 deletions

View File

@ -1,4 +1,8 @@
<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="build\dependencies.props" />

View File

@ -1,2 +1,2 @@
version:2.1.0-preview1-15551
commithash:8fad9553b48533fddbb16a423ea55b9710ea2e63
version:2.1.0-preview1-15569
commithash:47312a6364ad0ee6d7052eada54da940c9b17931

View File

@ -1,6 +1,13 @@
<Project>
<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>
<PropertyGroup>
<!--
Workaround for "Use executable flags in Microsoft.NET.Test.Sdk" (https://github.com/Microsoft/vstest/issues/792).

View File

@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
var stream = new HttpRequestStream(Mock.Of<IHttpBodyControlFeature>());
Assert.Throws<NotSupportedException>(() => stream.BeginWrite(new byte[1], 0, 1, null, null));
}
#elif NETCOREAPP2_0
#elif NETCOREAPP2_0 || NETCOREAPP2_1
#else
#error Target framework needs to be updated
#endif

View File

@ -3,8 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.AspNetCore.Server.Kestrel.Core.Tests</AssemblyName>
<RootNamespace>Microsoft.AspNetCore.Server.Kestrel.Core.Tests</RootNamespace>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

View File

@ -1,7 +1,7 @@
// 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.
#if NETCOREAPP2_0
#if NETCOREAPP2_0 || NETCOREAPP2_1
using System.IO;
using Xunit;

View File

@ -3,8 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.AspNetCore.Server.Kestrel.Tests</AssemblyName>
<RootNamespace>Microsoft.AspNetCore.Server.Kestrel.Tests</RootNamespace>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

View File

@ -3,8 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.FunctionalTests</AssemblyName>
<RootNamespace>Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.FunctionalTests</RootNamespace>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(DefineConstants);MACOS</DefineConstants>
<ServerGarbageCollection>true</ServerGarbageCollection>
<!-- Put this project into its own test group to avoid running parallel with other test projects. Libuv does not play nice with other test assemblies. -->
@ -17,7 +16,7 @@
<Content Include="..\shared\TestCertificates\*.pfx" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<ItemGroup Condition="'$(TargetFramework)' != 'net461'">
<ProjectReference Include="..\..\tools\CodeGenerator\CodeGenerator.csproj" />
</ItemGroup>

View File

@ -3,8 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Tests</AssemblyName>
<RootNamespace>Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Tests</RootNamespace>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>

View File

@ -3,8 +3,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.FunctionalTests</AssemblyName>
<RootNamespace>Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.FunctionalTests</RootNamespace>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(DefineConstants);MACOS</DefineConstants>
<DefineConstants>$(DefineConstants);SOCKETS</DefineConstants>
<ServerGarbageCollection>true</ServerGarbageCollection>
@ -16,7 +15,7 @@
<Content Include="..\shared\TestCertificates\*.pfx" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<ItemGroup Condition="'$(TargetFramework)' != 'net461'">
<ProjectReference Include="..\..\tools\CodeGenerator\CodeGenerator.csproj" />
</ItemGroup>