Skip to content

Commit 6d8b50c

Browse files
author
ladeak
committed
Custom new HttpClientHandler() when HttpSymbolServer is built on .netstandard
1 parent 9ca092a commit 6d8b50c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/Microsoft.SymbolStore/SymbolStores/HttpSymbolStore.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ public HttpSymbolStore(ITracer tracer, SymbolStore backingStore, Uri symbolServe
6767
_authenticationFunc = authenticationFunc;
6868

6969
// Create client
70-
_client = new HttpClient
70+
#if NETSTANDARD2_0
71+
_client = new HttpClient(new HttpClientHandler()
72+
{
73+
UseProxy = true,
74+
DefaultProxyCredentials = CredentialCache.DefaultNetworkCredentials,
75+
})
76+
#else
77+
_client = new HttpClient()
78+
#endif
7179
{
7280
Timeout = TimeSpan.FromMinutes(4)
7381
};

src/Tools/dotnet-dump/Analyzer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ or NotSupportedException
104104
contextService.SetCurrentTarget(target);
105105

106106
// Automatically enable symbol server support, default cache and search for symbols in the dump directory
107-
HttpClient.DefaultProxy.Credentials = CredentialCache.DefaultCredentials;
108107
symbolService.AddSymbolServer(retryCount: 3);
109108
symbolService.AddCachePath(symbolService.DefaultSymbolCache);
110109
symbolService.AddDirectoryPath(Path.GetDirectoryName(dump_path.FullName));

src/Tools/dotnet-symbol/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ internal async Task DownloadFiles()
265265
private Microsoft.SymbolStore.SymbolStores.SymbolStore BuildSymbolStore()
266266
{
267267
Microsoft.SymbolStore.SymbolStores.SymbolStore store = null;
268-
HttpClient.DefaultProxy.Credentials = CredentialCache.DefaultCredentials;
269268
foreach (ServerInfo server in ((IEnumerable<ServerInfo>)SymbolServers).Reverse())
270269
{
271270
if (server.InternalSymwebServer)

0 commit comments

Comments
 (0)