File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
src/Microsoft.Extensions.ServiceDiscovery Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
- <TargetFramework >$(DefaultTargetFramework)</ TargetFramework >
4
+ <TargetFrameworks >$(DefaultTargetFramework);net462</ TargetFrameworks >
5
5
<IsPackable >true</IsPackable >
6
- <IsAotCompatible >true</IsAotCompatible >
6
+ <IsAotCompatible Condition = " '$(TargetFramework)' != 'net462' " >true</IsAotCompatible >
7
7
<Description >Provides extensions to HttpClient that enable service discovery based on configuration.</Description >
8
8
<PackageIconFullPath >$(DefaultDotnetIconFullPath)</PackageIconFullPath >
9
9
</PropertyGroup >
10
10
11
11
<ItemGroup >
12
12
<PackageReference Include =" Microsoft.Extensions.Http" />
13
- <InternalsVisibleTo Include =" Microsoft.Extensions.ServiceDiscovery.Tests" />
14
- <InternalsVisibleTo Include =" Microsoft.Extensions.ServiceDiscovery.Dns.Tests" />
13
+ <InternalsVisibleTo Include =" Microsoft.Extensions.ServiceDiscovery.Tests" />
14
+ <InternalsVisibleTo Include =" Microsoft.Extensions.ServiceDiscovery.Dns.Tests" />
15
15
</ItemGroup >
16
16
17
17
<ItemGroup >
18
18
<ProjectReference Include =" ..\Microsoft.Extensions.ServiceDiscovery.Abstractions\Microsoft.Extensions.ServiceDiscovery.Abstractions.csproj" />
19
19
</ItemGroup >
20
20
21
+ <ItemGroup Condition =" '$(TargetFramework)' == 'net462' " >
22
+ <PackageReference Include =" Microsoft.Bcl.TimeProvider" />
23
+ </ItemGroup >
24
+
25
+ <Import Project =" $(SharedDir)FxPolyfills\FxPolyfills.targets" />
26
+
21
27
</Project >
Original file line number Diff line number Diff line change 1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- using Microsoft . Extensions . DependencyInjection . Extensions ;
5
- using Microsoft . Extensions . Http ;
6
4
using Microsoft . Extensions . Options ;
7
5
using Microsoft . Extensions . ServiceDiscovery ;
8
6
using Microsoft . Extensions . ServiceDiscovery . Http ;
9
7
8
+ #if NET
9
+ using Microsoft . Extensions . DependencyInjection . Extensions ;
10
+ using Microsoft . Extensions . Http ;
11
+ #endif
12
+
10
13
namespace Microsoft . Extensions . DependencyInjection ;
11
14
12
15
/// <summary>
@@ -34,13 +37,15 @@ public static IHttpClientBuilder AddServiceDiscovery(this IHttpClientBuilder htt
34
37
return new ResolvingHttpDelegatingHandler ( registry , options ) ;
35
38
} ) ;
36
39
40
+ #if NET
37
41
// Configure the HttpClient to disable gRPC load balancing.
38
42
// This is done on all HttpClient instances but only impacts gRPC clients.
39
43
AddDisableGrpcLoadBalancingFilter ( httpClientBuilder . Services , httpClientBuilder . Name ) ;
40
-
44
+ #endif
41
45
return httpClientBuilder ;
42
46
}
43
47
48
+ #if NET
44
49
private static void AddDisableGrpcLoadBalancingFilter ( IServiceCollection services , string ? name )
45
50
{
46
51
// A filter is used because it will always run last. This is important because the disable
@@ -86,4 +91,5 @@ public Action<HttpMessageHandlerBuilder> Configure(Action<HttpMessageHandlerBuil
86
91
} ;
87
92
}
88
93
}
94
+ #endif
89
95
}
You can’t perform that action at this time.
0 commit comments