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

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 17, 2024

Summary

Running dotnet tool update -g -all would fail starting in 8.0.4xx. A fix is pending for that branch as well which has different code. This is due to a NullReferenceException -- when calling a delegate function it can return null in the global mode and thus did not check whether the member was null correctly.

Customer Impact

For customers upgrading from any .NET version before 8.0.4xx, customers and CI would be broken as well in any scenario that requires updating a global .NET Tool.

Regression

This was an existing behavior in 8.0.4xx where update --all has been totally broken with -g.

Testing

Manual testing has been done to confirm the behavior before and after. A test is not provided due to the nature of the change requiring the store, which is an online component and the issue is not exposable with the mocking code that is currently in place.

Risk

The risk is low; the behavior did not work before. It adds protection against the 'store' or source of places to get .NET tools from being null, which is the expected case with a global tool install.

Backport of #43157 to release/9.0.1xx-rc2

/cc @nagilson @DL444

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Sep 17, 2024
@nagilson nagilson enabled auto-merge September 17, 2024 20:38
@nagilson nagilson disabled auto-merge September 17, 2024 21:43
@nagilson nagilson added Servicing-consider and removed untriaged Request triage from a team member labels Sep 17, 2024
@marcpopMSFT marcpopMSFT merged commit ecf792c into release/9.0.1xx-rc2 Sep 18, 2024
31 checks passed
@marcpopMSFT marcpopMSFT deleted the backport/pr-43157-to-release/9.0.1xx-rc2 branch September 18, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants