Skip to content

[release/8.0.4xx] Fix NullReferenceException for dotnet tool update -g --all #43550

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 1 commit into from
Sep 18, 2024
Merged

[release/8.0.4xx] Fix NullReferenceException for dotnet tool update -g --all #43550

merged 1 commit into from
Sep 18, 2024

Conversation

DL444
Copy link
Contributor

@DL444 DL444 commented Sep 18, 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.

--
Backports #43157 to .NET 8 and addresses #42598.

#43158 does not need backporting as the related optimization was not applied to .NET 8.

@nagilson
Copy link
Member

Thank you so much for taking the time to do this!

@nagilson nagilson merged commit beb3f36 into dotnet:release/8.0.4xx Sep 18, 2024
17 checks passed
@nagilson
Copy link
Member

nagilson commented Sep 18, 2024

This technically needed to go through 'ask mode', so I need to revert this change and then we need to merge it again with approval. I meant to click the other tab 😖

@nagilson
Copy link
Member

Ok, I'll submit this for approval under the notion that I accidentally merged it already. If it's not approved, then we will merge the revert PR and make sure the release timeline for it is OK.

@nagilson
Copy link
Member

We got approved.

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.

2 participants