Change compilation targets.

* Remove net451 as a compilation target
* Upgrade to netcoreapp2.0
This commit is contained in:
Pranav K 2017-03-12 08:42:19 -07:00
parent ddb5de0f77
commit 237abd0b69
23 changed files with 59 additions and 57 deletions

1
.gitignore vendored
View File

@ -32,3 +32,4 @@ project.lock.json
launchSettings.json
.build/
.testPublish/
global.json

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

View File

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
@ -13,6 +13,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="$(AspNetCoreVersion)" />
<PackageReference Include="System.Security.Claims" Version="$(CoreFxVersion)" />
</ItemGroup>
</Project>

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

View File

@ -1,10 +1,5 @@
using System;
#if NET451
using System.Runtime.Remoting;
using System.Runtime.Remoting.Messaging;
#else
using System.Threading;
#endif
namespace Microsoft.AspNetCore.Diagnostics.Elm
{
@ -25,27 +20,6 @@ namespace Microsoft.AspNetCore.Diagnostics.Elm
public ScopeNode Node { get; set; }
#if NET451
private static readonly string FieldKey = $"{typeof(ElmScope).FullName}.Value.{AppDomain.CurrentDomain.Id}";
public static ElmScope Current
{
get
{
var handle = CallContext.LogicalGetData(FieldKey) as ObjectHandle;
if (handle == null)
{
return default(ElmScope);
}
return (ElmScope)handle.Unwrap();
}
set
{
CallContext.LogicalSetData(FieldKey, new ObjectHandle(value));
}
}
#else
private static AsyncLocal<ElmScope> _value = new AsyncLocal<ElmScope>();
public static ElmScope Current
{
@ -58,7 +32,6 @@ namespace Microsoft.AspNetCore.Diagnostics.Elm
return _value.Value;
}
}
#endif
public static IDisposable Push(ElmScope scope, ElmStore store)
{

View File

@ -5,7 +5,7 @@
<PropertyGroup>
<Description>ASP.NET Core Error Logging Middleware (ELM) to capture and display request logs.</Description>
<VersionPrefix>0.3.0</VersionPrefix>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;diagnostics</PackageTags>

View File

@ -4,7 +4,7 @@
<PropertyGroup>
<Description>ASP.NET Core middleware for Entity Framework Core error pages. Use this middleware to detect and diagnose errors with Entity Framework Core migrations.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;diagnostics;entityframeworkcore</PackageTags>
@ -21,8 +21,4 @@
<DotNetCliToolReference Include="RazorPageGenerator" Version="$(AspNetCoreVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net451'">
<Reference Include="System.Configuration" />
</ItemGroup>
</Project>

View File

@ -4,7 +4,7 @@
<PropertyGroup>
<Description>ASP.NET Core middleware for exception handling, exception display pages, and diagnostics information. Includes developer exception page middleware, exception handler middleware, runtime info middleware, status code page middleware, and welcome page middleware</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;diagnostics</PackageTags>
@ -30,12 +30,9 @@
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All"/>
<PackageReference Include="Microsoft.Extensions.TypeNameHelper.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All"/>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(CoreFxVersion)" />
<PackageReference Include="System.Diagnostics.StackTrace" Version="$(CoreFxVersion)" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
<DotNetCliToolReference Include="RazorPageGenerator" Version="$(AspNetCoreVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.3'">
<PackageReference Include="System.Diagnostics.StackTrace" Version="$(CoreFxVersion)" />
</ItemGroup>
</Project>

View File

@ -4,7 +4,7 @@
<PropertyGroup>
<Description>ASP.NET Core middleware for analyzing middleware in the request pipeline with System.Diagnostics.DiagnosticSource.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;diagnostics</PackageTags>

View File

@ -11,7 +11,6 @@ using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests.Helpers;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.Helpers;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost;

View File

@ -0,0 +1,19 @@
// 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.Linq;
using System.Reflection;
namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests.Helpers
{
public class StringsHelpers
{
public static string GetResourceString(string stringName, params object[] parameters)
{
var strings = typeof(DatabaseErrorPageMiddleware).GetTypeInfo().Assembly.GetType("Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Strings").GetTypeInfo();
var method = strings.GetDeclaredMethods(stringName).Single();
return (string)method.Invoke(null, parameters);
}
}
}

View File

@ -3,16 +3,22 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<!-- Mitigation for long path issues in the app.config -->
<AssemblyName>Diagnostics.EFCore.FunctionalTests</AssemblyName>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj" />
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />

View File

@ -8,7 +8,7 @@ using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.Helpers;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests.Helpers;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost;

View File

@ -4,7 +4,7 @@ using Xunit;
namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests
{
#if NET452
#if NET46
public class DataStoreErrorLoggerTest
{
private const string _name = "test";

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
</PropertyGroup>

View File

@ -3,10 +3,12 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<SignAssembly>false</SignAssembly>
<PublicSign>false</PublicSign>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<ItemGroup>

View File

@ -305,7 +305,7 @@ namespace Microsoft.AspNetCore.Diagnostics.Tests
Assert.Empty(store.GetActivities());
}
#if NET452
#if NET46
private static void DomainFunc()
{
var t = SetUp();

View File

@ -3,8 +3,10 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<ItemGroup>
@ -30,6 +32,10 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net46'">
<PackageReference Include="System.Security.Claims" Version="$(CoreFxVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

View File

@ -3,8 +3,10 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<ItemGroup>