Skip to content

Commit 07b406e

Browse files
committed
Fixing tests
1 parent 18fe08f commit 07b406e

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/HostingExtension.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ public static class HostingExtension
88
{
99
public static IWebHostBuilder UseUnityServiceProvider(this IWebHostBuilder hostBuilder, IUnityContainer container = null)
1010
{
11+
#if NETCOREAPP1_1
12+
return hostBuilder.ConfigureServices((services) =>
13+
{
14+
services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IUnityContainer>>(new ServiceProviderFactory(container)));
15+
});
16+
#else
1117
return hostBuilder.ConfigureServices((context, services) =>
1218
{
1319
services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IUnityContainer>>(new ServiceProviderFactory(container)));
1420
});
21+
#endif
1522
}
1623
}
1724
}

src/Unity.Microsoft.DependencyInjection.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
<RootNamespace>Unity.Microsoft.DependencyInjection</RootNamespace>
2020
<UnityAbstractions>..\..\Abstractions\src\Unity.Abstractions.csproj</UnityAbstractions>
2121
<UnityContainer>..\..\Container\src\Unity.Container.csproj</UnityContainer>
22+
<TargetFrameworks>netcoreapp1.1;netstandard2.0</TargetFrameworks>
2223
</PropertyGroup>
2324

2425

2526

2627
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
27-
<TargetFramework>netstandard2.0</TargetFramework>
28+
<!--TargetFramework>netstandard2.0</TargetFramework-->
2829
</PropertyGroup>
2930

3031
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
3132
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
32-
<TargetFrameworks>netcoreapp1.1;netstandard2.0</TargetFrameworks>
3333
</PropertyGroup>
3434

3535

tests/Microsoft.DependencyInjection.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
<ProjectReference Include="..\src\Unity.Microsoft.DependencyInjection.csproj" />
1717
</ItemGroup>
1818

19-
<ItemGroup Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' == 'netstandard1.0' ">
19+
<ItemGroup Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' == 'netcoreapp1.1' ">
2020
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Specification.Tests" Version="1.1.*" />
2121
</ItemGroup>
2222

23-
<ItemGroup Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' == 'netstandard2.0' ">
23+
<ItemGroup Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' == 'netcoreapp2.0' ">
2424
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Specification.Tests" Version="2.0.*" />
2525
</ItemGroup>
2626

0 commit comments

Comments
 (0)