@@ -249,15 +249,12 @@ public static async Task DotnetRunAsync(
249249 throw new ArgumentNullException ( nameof ( action ) ) ;
250250 }
251251
252- var httpPort = PortHelper . GetFreeTcpPort ( ) ;
253- var httpUrl = new Uri ( $ "http://localhost:{ httpPort } ") ;
254-
255252 var httpClientHandler = new HttpClientHandler ( )
256253 {
257254 AllowAutoRedirect = false ,
258255 ServerCertificateCustomValidationCallback = validateCertificate ?? DefaultValidateCertificate ,
259256 } ;
260- var httpClient = new HttpClient ( httpClientHandler ) { BaseAddress = httpUrl } ;
257+ var httpClient = new HttpClient ( httpClientHandler ) { BaseAddress = project . HttpUrl } ;
261258
262259 var projectFilePath = Path . Combine ( project . DirectoryPath , projectRelativeDirectoryPath ) ;
263260 var dotnetRun = await DotnetRunInternalAsync (
@@ -267,8 +264,7 @@ public static async Task DotnetRunAsync(
267264 projectFilePath ,
268265 noRestore ,
269266 timeout ,
270- showShellWindow ,
271- httpUrl )
267+ showShellWindow )
272268 . ConfigureAwait ( false ) ;
273269
274270 try
@@ -320,18 +316,13 @@ public static async Task DotnetRunAsync(
320316 throw new ArgumentNullException ( nameof ( action ) ) ;
321317 }
322318
323- var httpPort = PortHelper . GetFreeTcpPort ( ) ;
324- var httpsPort = PortHelper . GetFreeTcpPort ( ) ;
325- var httpUrl = new Uri ( $ "http://localhost:{ httpPort } ") ;
326- var httpsUrl = new Uri ( $ "https://localhost:{ httpsPort } ") ;
327-
328319 var httpClientHandler = new HttpClientHandler ( )
329320 {
330321 AllowAutoRedirect = false ,
331322 ServerCertificateCustomValidationCallback = validateCertificate ?? DefaultValidateCertificate ,
332323 } ;
333- var httpClient = new HttpClient ( httpClientHandler ) { BaseAddress = httpUrl } ;
334- var httpsClient = new HttpClient ( httpClientHandler ) { BaseAddress = httpsUrl } ;
324+ var httpClient = new HttpClient ( httpClientHandler ) { BaseAddress = project . HttpUrl } ;
325+ var httpsClient = new HttpClient ( httpClientHandler ) { BaseAddress = project . HttpsUrl } ;
335326
336327 var projectFilePath = Path . Combine ( project . DirectoryPath , projectRelativeDirectoryPath ) ;
337328 var dotnetRun = await DotnetRunInternalAsync (
@@ -341,9 +332,7 @@ public static async Task DotnetRunAsync(
341332 projectFilePath ,
342333 noRestore ,
343334 timeout ,
344- showShellWindow ,
345- httpUrl ,
346- httpsUrl )
335+ showShellWindow )
347336 . ConfigureAwait ( false ) ;
348337
349338 try
@@ -426,18 +415,16 @@ private static async Task<IAsyncDisposable> DotnetRunInternalAsync(
426415 string directoryPath ,
427416 bool ? noRestore ,
428417 TimeSpan ? timeout ,
429- bool showShellWindow ,
430- params Uri [ ] urls )
418+ bool showShellWindow )
431419 {
432420#pragma warning disable CA2000 // Dispose objects before losing scope. Object disposed below.
433421 var cancellationTokenSource = new CancellationTokenSource ( ) ;
434422#pragma warning restore CA2000 // Dispose objects before losing scope. Object disposed below.
435423 var noRestoreArgument = noRestore is null ? null : "--no-restore" ;
436- var urlsParameter = string . Join ( ";" , urls . Select ( x => x . ToString ( ) ) ) ;
437424 var task = AssertStartAsync (
438425 directoryPath ,
439426 "dotnet" ,
440- $ "run { noRestoreArgument } --urls { urlsParameter } ",
427+ $ "run { noRestoreArgument } ",
441428 showShellWindow ,
442429 cancellationTokenSource . Token ) ;
443430
0 commit comments