diff --git a/package.props b/package.props index ada9465..5d4faab 100644 --- a/package.props +++ b/package.props @@ -1,7 +1,7 @@ - 5.9.0 + 5.9.1 This package is an Unity adapter to Microsoft.Extensions.Logging.2+ diff --git a/src/LoggingExtension.cs b/src/LoggingExtension.cs index 428e639..3261e85 100644 --- a/src/LoggingExtension.cs +++ b/src/LoggingExtension.cs @@ -1,11 +1,10 @@ -using System; -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; +using System; using System.Reflection; -using System.Runtime.CompilerServices; +using System.Security; using Unity.Builder; using Unity.Extension; using Unity.Policy; -using System.Security; using Unity.Resolution; namespace Unity.Microsoft.Logging @@ -64,16 +63,7 @@ namespace Unity.Microsoft.Logging { return ((ref BuilderContext c) => { - Type declaringType = null; - - if (IntPtr.Zero != c.Parent) - { - unsafe - { - var parenContext = Unsafe.AsRef(c.Parent.ToPointer()); - declaringType = parenContext.RegistrationType; - } - } + Type declaringType = c.DeclaringType; return null == declaringType ? LoggerFactory.CreateLogger(c.Name ?? UnityContainer.All) diff --git a/src/Unity.Microsoft.Logging.csproj b/src/Unity.Microsoft.Logging.csproj index 4b5015d..29d3572 100644 --- a/src/Unity.Microsoft.Logging.csproj +++ b/src/Unity.Microsoft.Logging.csproj @@ -21,7 +21,6 @@ false Unity.Microsoft.Logging netstandard2.0 - true