Port https://github.com/dotnet/dotnet/pull/4642/changes#53194
Merged
marcpopMSFT merged 1 commit intorelease/11.0.1xx-preview2from Mar 2, 2026
Merged
Port https://github.com/dotnet/dotnet/pull/4642/changes#53194marcpopMSFT merged 1 commit intorelease/11.0.1xx-preview2from
marcpopMSFT merged 1 commit intorelease/11.0.1xx-preview2from
Conversation
Fixes #52819 The fix was made in the 2xx VMR and it has flowed back to the SDK and into 3xx but it's still stuck going to main so missed the preview 2 snap.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ports a fix from the 2xx VMR branch (dotnet/dotnet#4642) to the main branch of the SDK. It resolves issue #52819, where running dnx <tool> would throw an InvalidCastException because ToolExecuteCommand was typed to CommandBase<ToolExecuteCommandDefinition>, but when invoked via the dnx command alias the actual parsed command object is a DnxCommandDefinition (which inherits from ToolExecuteCommandDefinitionBase, not from ToolExecuteCommandDefinition). The fix widens the type parameter constraint to the shared base class, enabling both dnx and dotnet tool execute to share the same handler.
Changes:
ToolExecuteCommandnow extendsCommandBase<ToolExecuteCommandDefinitionBase>instead ofCommandBase<ToolExecuteCommandDefinition>, fixing the invalid cast when invoked viadnx.
Member
Author
|
/ba-g unrelated failures |
baronfel
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #52819
The fix was made in the 2xx VMR and it has flowed back to the SDK and into 3xx but it's still stuck going to main so missed the preview 2 snap.