Skip to content

Commit a72658b

Browse files
committed
Fixed Container#133
1 parent 2403732 commit a72658b

3 files changed

Lines changed: 5 additions & 16 deletions

File tree

package.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<Version>5.9.0</Version>
4+
<Version>5.9.1</Version>
55
<PackageReleaseNotes>This package is an Unity adapter to Microsoft.Extensions.Logging.2+</PackageReleaseNotes>
66
</PropertyGroup>
77

src/LoggingExtension.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using System;
2-
using Microsoft.Extensions.Logging;
1+
using Microsoft.Extensions.Logging;
2+
using System;
33
using System.Reflection;
4-
using System.Runtime.CompilerServices;
4+
using System.Security;
55
using Unity.Builder;
66
using Unity.Extension;
77
using Unity.Policy;
8-
using System.Security;
98
using Unity.Resolution;
109

1110
namespace Unity.Microsoft.Logging
@@ -64,16 +63,7 @@ public ResolveDelegate<BuilderContext> GetResolver(ref BuilderContext context)
6463
{
6564
return ((ref BuilderContext c) =>
6665
{
67-
Type declaringType = null;
68-
69-
if (IntPtr.Zero != c.Parent)
70-
{
71-
unsafe
72-
{
73-
var parenContext = Unsafe.AsRef<BuilderContext>(c.Parent.ToPointer());
74-
declaringType = parenContext.RegistrationType;
75-
}
76-
}
66+
Type declaringType = c.DeclaringType;
7767

7868
return null == declaringType
7969
? LoggerFactory.CreateLogger(c.Name ?? UnityContainer.All)

src/Unity.Microsoft.Logging.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<DelaySign>false</DelaySign>
2222
<RootNamespace>Unity.Microsoft.Logging</RootNamespace>
2323
<TargetFramework>netstandard2.0</TargetFramework>
24-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2524
</PropertyGroup>
2625

2726
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">

0 commit comments

Comments
 (0)