Skip to content

Commit

Permalink
Fixed #70
Browse files Browse the repository at this point in the history
  • Loading branch information
ENikS committed Dec 12, 2019
1 parent 8ea1ed7 commit ef0d013
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<Version>5.11.4</Version>
<Version>5.11.5</Version>
<PackageReleaseNotes>This release is compatible with Core 3.1</PackageReleaseNotes>
</PropertyGroup>

Expand Down
11 changes: 6 additions & 5 deletions src/Extensions/HostingExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ public static IHostBuilder UseUnityServiceProvider(this IHostBuilder hostBuilder
{
_factory = new ServiceProviderFactory(container);

return hostBuilder.ConfigureServices((context, services) =>
{
services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IUnityContainer>>(_factory));
services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(_factory));
});
return hostBuilder.UseServiceProviderFactory<IUnityContainer>(_factory)
.ConfigureServices((context, services) =>
{
services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IUnityContainer>>(_factory));
services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(_factory));
});
}

public static IWebHostBuilder UseUnityServiceProvider(this IWebHostBuilder hostBuilder, IUnityContainer container = null)
Expand Down

0 comments on commit ef0d013

Please sign in to comment.