diff --git a/build.sh b/build.sh index dc51fc0..6d1ff38 100644 --- a/build.sh +++ b/build.sh @@ -3,7 +3,6 @@ dotnet --info dotnet restore for path in src/**/*.csproj; do - dotnet build -f netstandard1.3 -c Release ${path} dotnet build -f netstandard2.0 -c Release ${path} done diff --git a/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs b/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs index b4905ff..3590071 100644 --- a/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs +++ b/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs @@ -2,12 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -#if ASYNCLOCAL using System.Threading; -#else -using System.Runtime.Remoting; -using System.Runtime.Remoting.Messaging; -#endif using Microsoft.Extensions.Logging; using Serilog.Core; using Serilog.Events; @@ -93,7 +88,6 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) } } -#if ASYNCLOCAL readonly AsyncLocal _value = new AsyncLocal(); internal SerilogLoggerScope CurrentScope @@ -107,22 +101,6 @@ internal SerilogLoggerScope CurrentScope _value.Value = value; } } -#else - readonly string _currentScopeKey = nameof(SerilogLoggerScope) + "#" + Guid.NewGuid().ToString("n"); - - internal SerilogLoggerScope CurrentScope - { - get - { - var objectHandle = CallContext.LogicalGetData(_currentScopeKey) as ObjectHandle; - return objectHandle?.Unwrap() as SerilogLoggerScope; - } - set - { - CallContext.LogicalSetData(_currentScopeKey, new ObjectHandle(value)); - } - } -#endif /// public void Dispose() diff --git a/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj b/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj index eeaa59c..40b882d 100644 --- a/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj +++ b/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj @@ -1,4 +1,4 @@ - + Low-level Serilog provider for Microsoft.Extensions.Logging diff --git a/test/Serilog.Extensions.Logging.Tests/Serilog.Extensions.Logging.Tests.csproj b/test/Serilog.Extensions.Logging.Tests/Serilog.Extensions.Logging.Tests.csproj index 7f8a2ff..e1a144a 100644 --- a/test/Serilog.Extensions.Logging.Tests/Serilog.Extensions.Logging.Tests.csproj +++ b/test/Serilog.Extensions.Logging.Tests/Serilog.Extensions.Logging.Tests.csproj @@ -1,4 +1,4 @@ - + netcoreapp2.0;net472