diff --git a/appveyor.yml b/appveyor.yml index 34eac1c..c4ba498 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -image: Visual Studio 2019 Preview +image: Visual Studio 2019 configuration: Release platform: Any CPU diff --git a/package.props b/package.props index 2f31c1d..7aaa6f1 100644 --- a/package.props +++ b/package.props @@ -1,7 +1,7 @@ - 5.11.4 + 5.11.5 This release is compatible with Core 3.1 diff --git a/src/Extensions/HostingExtension.cs b/src/Extensions/HostingExtension.cs index 2e278bb..a1178f3 100644 --- a/src/Extensions/HostingExtension.cs +++ b/src/Extensions/HostingExtension.cs @@ -14,11 +14,12 @@ public static IHostBuilder UseUnityServiceProvider(this IHostBuilder hostBuilder { _factory = new ServiceProviderFactory(container); - return hostBuilder.ConfigureServices((context, services) => - { - services.Replace(ServiceDescriptor.Singleton>(_factory)); - services.Replace(ServiceDescriptor.Singleton>(_factory)); - }); + return hostBuilder.UseServiceProviderFactory(_factory) + .ConfigureServices((context, services) => + { + services.Replace(ServiceDescriptor.Singleton>(_factory)); + services.Replace(ServiceDescriptor.Singleton>(_factory)); + }); } public static IWebHostBuilder UseUnityServiceProvider(this IWebHostBuilder hostBuilder, IUnityContainer container = null) diff --git a/src/Unity.Microsoft.DependencyInjection.csproj b/src/Unity.Microsoft.DependencyInjection.csproj index c59c159..b001bdf 100644 --- a/src/Unity.Microsoft.DependencyInjection.csproj +++ b/src/Unity.Microsoft.DependencyInjection.csproj @@ -25,7 +25,7 @@ false - netcoreapp3.1 + netstandard2.0 Full