diff --git a/build-tools/xaprepare/xaprepare/Application/Utilities.cs b/build-tools/xaprepare/xaprepare/Application/Utilities.cs index 3f1bdfbe1e0..eb2a9393525 100644 --- a/build-tools/xaprepare/xaprepare/Application/Utilities.cs +++ b/build-tools/xaprepare/xaprepare/Application/Utilities.cs @@ -488,10 +488,7 @@ public static HttpClient CreateHttpClient () try { using (HttpClient httpClient = CreateHttpClient ()) { httpClient.Timeout = WebRequestTimeout; - var req = new HttpRequestMessage (HttpMethod.Head, url); - req.Headers.ConnectionClose = true; - - HttpResponseMessage resp = await httpClient.SendAsync (req, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait (true); + HttpResponseMessage resp = await httpClient.GetAsync (url, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait (true); if (!resp.IsSuccessStatusCode || !resp.Content.Headers.ContentLength.HasValue) return (false, 0, resp.StatusCode); diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs b/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs index 705b2b11da9..637d5e8f3cc 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs @@ -22,7 +22,7 @@ protected override async Task Execute (Context context) dotnetPath = dotnetPath.TrimEnd (new char [] { Path.DirectorySeparatorChar }); if (!await InstallDotNetAsync (context, dotnetPath, BuildToolVersion)) { - Log.ErrorLine ($"Installation of dotnet SDK {BuildToolVersion} failed."); + Log.ErrorLine ($"Installation of dotnet SDK '{BuildToolVersion}' failed."); return false; } @@ -47,7 +47,7 @@ protected override async Task Execute (Context context) ProcessRunner.QuoteArgument ($"-bl:{logPath}"), }; if (!Utilities.RunCommand (Configurables.Paths.DotNetPreviewTool, restoreArgs)) { - Log.ErrorLine ($"dotnet restore {packageDownloadProj} failed."); + Log.ErrorLine ($"Failed to restore runtime packs using '{packageDownloadProj}'."); return false; } @@ -74,18 +74,19 @@ async Task DownloadDotNetInstallScript (Context context, string dotnetScri string tempDotnetScriptPath = dotnetScriptPath + "-tmp"; Utilities.DeleteFile (tempDotnetScriptPath); - Log.StatusLine ("Downloading dotnet-install..."); + Log.StatusLine ("Downloading dotnet-install script..."); (bool success, ulong size, HttpStatusCode status) = await Utilities.GetDownloadSizeWithStatus (dotnetScriptUrl); if (!success) { string message; if (status == HttpStatusCode.NotFound) { - message = "dotnet-install URL not found"; + message = $"dotnet-install URL '{dotnetScriptUrl}' not found."; } else { - message = $"Failed to obtain dotnet-install size. HTTP status code: {status} ({(int)status})"; + message = $"Failed to obtain dotnet-install script size from URL '{dotnetScriptUrl}'. HTTP status code: {status} ({(int)status})"; } - return ReportAndCheckCached (message, quietOnError: true); + if (ReportAndCheckCached (message, quietOnError: true)) + return true; } DownloadStatus downloadStatus = Utilities.SetupDownloadStatus (context, size, context.InteractiveSession); @@ -192,6 +193,7 @@ async Task InstallDotNetAsync (Context context, string dotnetPath, string string scriptFileName = Path.GetFileName (dotnetScriptUrl.LocalPath); string cachedDotnetScriptPath = Path.Combine (cacheDir, scriptFileName); if (!await DownloadDotNetInstallScript (context, cachedDotnetScriptPath, dotnetScriptUrl)) { + Log.ErrorLine ($"Failed to download dotnet-install script."); return false; }