diff --git a/.gitignore b/.gitignore index 023ffa1262..1afa31c963 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ project.lock.json launchSettings.json .build/ .testPublish/ +global.json diff --git a/samples/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj b/samples/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj index e4b3d45922..96176005ab 100644 --- a/samples/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj +++ b/samples/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj @@ -3,7 +3,7 @@ - net451;netcoreapp1.1 + net46;netcoreapp1.1 diff --git a/samples/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj b/samples/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj index 5dd1a6225b..21da38788a 100644 --- a/samples/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj +++ b/samples/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj @@ -3,7 +3,7 @@ - net451;netcoreapp1.1 + net46;netcoreapp1.1 diff --git a/samples/ElmPageSample/ElmPageSample.csproj b/samples/ElmPageSample/ElmPageSample.csproj index a1c37bb480..e58bb2ad39 100644 --- a/samples/ElmPageSample/ElmPageSample.csproj +++ b/samples/ElmPageSample/ElmPageSample.csproj @@ -1,9 +1,9 @@ - + - net451;netcoreapp1.1 + net46;netcoreapp1.1 @@ -13,6 +13,7 @@ + diff --git a/samples/ExceptionHandlerSample/ExceptionHandlerSample.csproj b/samples/ExceptionHandlerSample/ExceptionHandlerSample.csproj index 207cae5b89..168311f292 100644 --- a/samples/ExceptionHandlerSample/ExceptionHandlerSample.csproj +++ b/samples/ExceptionHandlerSample/ExceptionHandlerSample.csproj @@ -3,7 +3,7 @@ - net451;netcoreapp1.1 + net46;netcoreapp1.1 diff --git a/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj b/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj index 3f01b2a0de..a2c0b5cb63 100644 --- a/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj +++ b/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj @@ -3,7 +3,7 @@ - net451;netcoreapp1.1 + net46;netcoreapp1.1 diff --git a/samples/StatusCodePagesSample/StatusCodePagesSample.csproj b/samples/StatusCodePagesSample/StatusCodePagesSample.csproj index 5dd1a6225b..21da38788a 100644 --- a/samples/StatusCodePagesSample/StatusCodePagesSample.csproj +++ b/samples/StatusCodePagesSample/StatusCodePagesSample.csproj @@ -3,7 +3,7 @@ - net451;netcoreapp1.1 + net46;netcoreapp1.1 diff --git a/samples/WelcomePageSample/WelcomePageSample.csproj b/samples/WelcomePageSample/WelcomePageSample.csproj index 5dd1a6225b..21da38788a 100644 --- a/samples/WelcomePageSample/WelcomePageSample.csproj +++ b/samples/WelcomePageSample/WelcomePageSample.csproj @@ -3,7 +3,7 @@ - net451;netcoreapp1.1 + net46;netcoreapp1.1 diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmScope.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmScope.cs index dc9e78dc01..f64ae23e69 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmScope.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmScope.cs @@ -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 _value = new AsyncLocal(); 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) { diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Microsoft.AspNetCore.Diagnostics.Elm.csproj b/src/Microsoft.AspNetCore.Diagnostics.Elm/Microsoft.AspNetCore.Diagnostics.Elm.csproj index 3e1b20f01d..2e01074c8f 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Microsoft.AspNetCore.Diagnostics.Elm.csproj +++ b/src/Microsoft.AspNetCore.Diagnostics.Elm/Microsoft.AspNetCore.Diagnostics.Elm.csproj @@ -5,7 +5,7 @@ ASP.NET Core Error Logging Middleware (ELM) to capture and display request logs. 0.3.0 - net451;netstandard1.3 + netstandard1.3 $(NoWarn);CS1591 true aspnetcore;diagnostics diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj index 4453af0339..1001bd9467 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj @@ -4,7 +4,7 @@ ASP.NET Core middleware for Entity Framework Core error pages. Use this middleware to detect and diagnose errors with Entity Framework Core migrations. - net451;netstandard1.3 + netstandard1.3 $(NoWarn);CS1591 true aspnetcore;diagnostics;entityframeworkcore @@ -21,8 +21,4 @@ - - - - diff --git a/src/Microsoft.AspNetCore.Diagnostics/Microsoft.AspNetCore.Diagnostics.csproj b/src/Microsoft.AspNetCore.Diagnostics/Microsoft.AspNetCore.Diagnostics.csproj index 6d74d69344..85d962bef3 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/Microsoft.AspNetCore.Diagnostics.csproj +++ b/src/Microsoft.AspNetCore.Diagnostics/Microsoft.AspNetCore.Diagnostics.csproj @@ -4,7 +4,7 @@ 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 - net451;netstandard1.3 + netstandard1.3 $(NoWarn);CS1591 true aspnetcore;diagnostics @@ -30,12 +30,9 @@ + - - - - diff --git a/src/Microsoft.AspNetCore.MiddlewareAnalysis/Microsoft.AspNetCore.MiddlewareAnalysis.csproj b/src/Microsoft.AspNetCore.MiddlewareAnalysis/Microsoft.AspNetCore.MiddlewareAnalysis.csproj index 94753010a3..03a1353410 100644 --- a/src/Microsoft.AspNetCore.MiddlewareAnalysis/Microsoft.AspNetCore.MiddlewareAnalysis.csproj +++ b/src/Microsoft.AspNetCore.MiddlewareAnalysis/Microsoft.AspNetCore.MiddlewareAnalysis.csproj @@ -4,7 +4,7 @@ ASP.NET Core middleware for analyzing middleware in the request pipeline with System.Diagnostics.DiagnosticSource. - net451;netstandard1.3 + netstandard1.3 $(NoWarn);CS1591 true aspnetcore;diagnostics diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs index a653852fa0..5113cdb156 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs +++ b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs @@ -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; diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/Helpers/StringHelpers.cs b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/Helpers/StringHelpers.cs new file mode 100644 index 0000000000..6b4263791a --- /dev/null +++ b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/Helpers/StringHelpers.cs @@ -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); + } + } +} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests.csproj b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests.csproj index 8a4f249a40..1b41381bde 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests.csproj @@ -3,16 +3,22 @@ - netcoreapp1.1;net452 + netcoreapp1.1;net46 netcoreapp1.1 + true + true + + Diagnostics.EFCore.FunctionalTests - + + + diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/MigrationsEndPointMiddlewareTest.cs b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/MigrationsEndPointMiddlewareTest.cs index 8a1a493cfa..29bcca8ed0 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/MigrationsEndPointMiddlewareTest.cs +++ b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.FunctionalTests/MigrationsEndPointMiddlewareTest.cs @@ -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; diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/DataStoreErrorLoggerTest.cs b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/DataStoreErrorLoggerTest.cs index e8a9e65837..e173b4554d 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/DataStoreErrorLoggerTest.cs +++ b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/DataStoreErrorLoggerTest.cs @@ -4,7 +4,7 @@ using Xunit; namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests { -#if NET452 +#if NET46 public class DataStoreErrorLoggerTest { private const string _name = "test"; diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj index 3fb3210ac0..8381cbf35d 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj +++ b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj @@ -3,7 +3,7 @@ - netcoreapp1.1;net452 + netcoreapp1.1;net46 netcoreapp1.1 diff --git a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/Microsoft.AspNetCore.Diagnostics.FunctionalTests.csproj b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/Microsoft.AspNetCore.Diagnostics.FunctionalTests.csproj index 9395020baa..bf832e85af 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/Microsoft.AspNetCore.Diagnostics.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/Microsoft.AspNetCore.Diagnostics.FunctionalTests.csproj @@ -3,10 +3,12 @@ - netcoreapp1.1;net452 + netcoreapp1.1;net46 netcoreapp1.1 false false + true + true diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmLoggerTest.cs b/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmLoggerTest.cs index 89753bdafa..c26d8ca134 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmLoggerTest.cs +++ b/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmLoggerTest.cs @@ -305,7 +305,7 @@ namespace Microsoft.AspNetCore.Diagnostics.Tests Assert.Empty(store.GetActivities()); } -#if NET452 +#if NET46 private static void DomainFunc() { var t = SetUp(); diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/Microsoft.AspNetCore.Diagnostics.Tests.csproj b/test/Microsoft.AspNetCore.Diagnostics.Tests/Microsoft.AspNetCore.Diagnostics.Tests.csproj index 69b27b5450..c3c7a58700 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.Tests/Microsoft.AspNetCore.Diagnostics.Tests.csproj +++ b/test/Microsoft.AspNetCore.Diagnostics.Tests/Microsoft.AspNetCore.Diagnostics.Tests.csproj @@ -3,8 +3,10 @@ - netcoreapp1.1;net452 + netcoreapp1.1;net46 netcoreapp1.1 + true + true @@ -30,6 +32,10 @@ + + + + diff --git a/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj b/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj index 272c5c02b6..caddfafafb 100644 --- a/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj +++ b/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj @@ -3,8 +3,10 @@ - netcoreapp1.1;net452 + netcoreapp1.1;net46 netcoreapp1.1 + true + true