diff --git a/examples/NetCore2/ConsoleExample/ConsoleExample.csproj b/examples/NetCore2/ConsoleExample/ConsoleExample.csproj index d0df14c9..82c1a524 100644 --- a/examples/NetCore2/ConsoleExample/ConsoleExample.csproj +++ b/examples/NetCore2/ConsoleExample/ConsoleExample.csproj @@ -1,14 +1,15 @@ + PackageReference + Exe netcoreapp2.0 - + - diff --git a/src/NLog.Extensions.Logging/ConfigureExtensions.cs b/src/NLog.Extensions.Logging/ConfigureExtensions.cs index a5fefd40..ad3796c1 100644 --- a/src/NLog.Extensions.Logging/ConfigureExtensions.cs +++ b/src/NLog.Extensions.Logging/ConfigureExtensions.cs @@ -40,8 +40,7 @@ public static ILoggerFactory AddNLog(this ILoggerFactory factory, NLogProviderOp return factory; } -#if NETSTANDARD2_0 - +#if !NETCORE1_0 /// /// Enable NLog as logging provider in .NET Core. /// @@ -75,6 +74,9 @@ private static void ConfigureHiddenAssemblies() try { //ignore these assemblies for ${callsite} +#if !NETCORE1_0 + LogManager.AddHiddenAssembly(typeof(Microsoft.Extensions.Logging.ILoggingBuilder).GetTypeInfo().Assembly); //Microsoft.Logging +#endif LogManager.AddHiddenAssembly(typeof(Microsoft.Extensions.Logging.LoggerFactoryExtensions).GetTypeInfo().Assembly); //Microsoft.Extensions.Logging LogManager.AddHiddenAssembly(typeof(Microsoft.Extensions.Logging.ILogger).GetTypeInfo().Assembly); // Microsoft.Extensions.Logging.Abstractions LogManager.AddHiddenAssembly(typeof(NLog.Extensions.Logging.ConfigureExtensions).GetTypeInfo().Assembly); //NLog.Extensions.Logging @@ -106,8 +108,7 @@ private static void ConfigureHiddenAssemblies() /// Current configuration for chaining. public static LoggingConfiguration ConfigureNLog(this ILoggerFactory loggerFactory, string configFileRelativePath) { - -#if NETCORE +#if NETCORE1_0 && !NET451 var rootPath = System.AppContext.BaseDirectory; #else var rootPath = AppDomain.CurrentDomain.BaseDirectory; diff --git a/src/NLog.Extensions.Logging/NLog.Extensions.Logging.csproj b/src/NLog.Extensions.Logging/NLog.Extensions.Logging.csproj index bfe6d86e..943bbdb0 100644 --- a/src/NLog.Extensions.Logging/NLog.Extensions.Logging.csproj +++ b/src/NLog.Extensions.Logging/NLog.Extensions.Logging.csproj @@ -36,7 +36,7 @@ rc2 (see https://github.com/NLog/NLog.Extensions.Logging/milestone/9?closed=1) - + @@ -45,7 +45,7 @@ rc2 (see https://github.com/NLog/NLog.Extensions.Logging/milestone/9?closed=1) - + @@ -53,8 +53,8 @@ rc2 (see https://github.com/NLog/NLog.Extensions.Logging/milestone/9?closed=1) - - $(DefineConstants);NETCORE + + $(DefineConstants);NETCORE1_0 bin\$(Configuration)\$(TargetFramework)\NLog.Extensions.Logging.xml @@ -66,12 +66,11 @@ rc2 (see https://github.com/NLog/NLog.Extensions.Logging/milestone/9?closed=1) - + - - + diff --git a/src/NLog.Extensions.Logging/NLogLogger.cs b/src/NLog.Extensions.Logging/NLogLogger.cs index 805b0b92..edd0e737 100644 --- a/src/NLog.Extensions.Logging/NLogLogger.cs +++ b/src/NLog.Extensions.Logging/NLogLogger.cs @@ -60,7 +60,7 @@ private LogEventInfo CreateLogEventInfo(LogLevel nLogLogLevel, string message, I { if (firstParameterName.Length != 1 || !char.IsDigit(firstParameterName[0])) { -#if NETSTANDARD2_0 +#if !NETSTANDARD1_3 var originalFormat = parameterList[parameterList.Count - 1]; string originalMessage = null; if (originalFormat.Key == OriginalFormatPropertyName) diff --git a/src/NLog.Extensions.Logging/NLogMessageParameterList.cs b/src/NLog.Extensions.Logging/NLogMessageParameterList.cs index 44de54d6..3bab83ed 100644 --- a/src/NLog.Extensions.Logging/NLogMessageParameterList.cs +++ b/src/NLog.Extensions.Logging/NLogMessageParameterList.cs @@ -7,7 +7,7 @@ namespace NLog.Extensions.Logging { -#if NETSTANDARD2_0 +#if !NETSTANDARD1_3 /// /// Converts Microsoft Extension Logging ParameterList into NLog MessageTemplate ParameterList /// diff --git a/test/NLog.Extensions.Logging.Tests.csproj b/test/NLog.Extensions.Logging.Tests.csproj index 852e2a67..5c49ebc4 100644 --- a/test/NLog.Extensions.Logging.Tests.csproj +++ b/test/NLog.Extensions.Logging.Tests.csproj @@ -1,40 +1,30 @@  - + + PackageReference + netcoreapp1.1;netcoreapp2.0;net461 - - - + + + - - - - - + - - - - - - - -