Skip to content

[release/9.0.1xx-rc2] Fix NullReferenceException for dotnet tool update -g --all #43516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@ private int ExecuteInstallCommand(PackageId packageId)

if (ToolVersionAlreadyInstalled(oldPackageNullable, nugetVersion))
{
_reporter.WriteLine(string.Format(LocalizableStrings.ToolAlreadyInstalled, _packageId, oldPackageNullable.Version.ToNormalizedString()).Green());
_reporter.WriteLine(string.Format(LocalizableStrings.ToolAlreadyInstalled, oldPackageNullable.Id, oldPackageNullable.Version.ToNormalizedString()).Green());
return 0;
}
}
10 changes: 6 additions & 4 deletions src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommand.cs
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
using Microsoft.DotNet.ToolManifest;
using Microsoft.DotNet.ToolPackage;
using Microsoft.DotNet.Tools.Tool.Common;
using Microsoft.Extensions.EnvironmentAbstractions;
using CreateShellShimRepository = Microsoft.DotNet.Tools.Tool.Install.CreateShellShimRepository;

namespace Microsoft.DotNet.Tools.Tool.Update
@@ -43,16 +44,17 @@ public ToolUpdateCommand(
localToolsResolverCache,
reporter);

_global = result.GetValue(ToolInstallCommandParser.GlobalOption);
_toolPath = result.GetValue(ToolInstallCommandParser.ToolPathOption);
DirectoryPath? location = string.IsNullOrWhiteSpace(_toolPath) ? null : new DirectoryPath(_toolPath);
_toolUpdateGlobalOrToolPathCommand =
toolUpdateGlobalOrToolPathCommand
?? new ToolUpdateGlobalOrToolPathCommand(
result,
createToolPackageStoreDownloaderUninstaller,
createShellShimRepository,
reporter);

_global = result.GetValue(ToolInstallCommandParser.GlobalOption);
_toolPath = result.GetValue(ToolInstallCommandParser.ToolPathOption);
reporter,
ToolPackageFactory.CreateToolPackageStoreQuery(location));
}



Unchanged files with check annotations Beta

</UrisToDownload>
</ItemGroup>
<DownloadFile Condition="'@(UrisToDownload)' != '' and %(ShouldDownload)"

Check failure on line 411 in src/Installer/redist-installer/targets/GenerateLayout.targets

Azure Pipelines / dotnet-sdk-public-ci (Build ContainerBased: linux (x64) [alpine319WithNode])

src/Installer/redist-installer/targets/GenerateLayout.targets#L411

src/Installer/redist-installer/targets/GenerateLayout.targets(411,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) HttpRequestException: Resource temporarily unavailable (dotnetcli.blob.core.windows.net:443) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.InjectNewHttp11ConnectionAsync(QueueItem queueItem) at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at Microsoft.DotNet.Arcade.Sdk.DownloadFile.DownloadWithRetriesAsync(HttpClient httpClient, String uri) in /_/src/Microsoft.DotNet.Arcade.Sdk/src/DownloadFile.cs:line 154 SocketException: Resource temporarily unavailable at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)

Check failure on line 411 in src/Installer/redist-installer/targets/GenerateLayout.targets

Azure Pipelines / dotnet-sdk-public-ci

src/Installer/redist-installer/targets/GenerateLayout.targets#L411

src/Installer/redist-installer/targets/GenerateLayout.targets(411,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) HttpRequestException: Resource temporarily unavailable (dotnetcli.blob.core.windows.net:443) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.InjectNewHttp11ConnectionAsync(QueueItem queueItem) at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at Microsoft.DotNet.Arcade.Sdk.DownloadFile.DownloadWithRetriesAsync(HttpClient httpClient, String uri) in /_/src/Microsoft.DotNet.Arcade.Sdk/src/DownloadFile.cs:line 154 SocketException: Resource temporarily unavailable at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
Uris="@(UrisToDownload)"
DestinationPath="%(DownloadDestination)" />