Respect NetCoreSdkRoot property for TaskHostParameters#13176
Merged
ViktorHofer merged 1 commit intomainfrom Feb 2, 2026
Merged
Respect NetCoreSdkRoot property for TaskHostParameters#13176ViktorHofer merged 1 commit intomainfrom
ViktorHofer merged 1 commit intomainfrom
Conversation
The property got added with dotnet/sdk@e0c4dda The RuntimeIdentifierGraphPath property is incorrect to use as customers set that to a custom .json file in certain scenarios (i.e. new RID).
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for the NetCoreSdkRoot property, which was introduced in .NET 11, to determine the MSBuild assembly path for .NET task host parameters. This addresses an issue where the previous approach of using RuntimeIdentifierGraphPath wasn't reliable since customers can set it to point to custom RID JSON files.
Changes:
- Adds
NetCoreSdkRootconstant for the new property name - Updates task host parameter logic to prefer
NetCoreSdkRootwith fallback toRuntimeIdentifierGraphPathfor backward compatibility with earlier SDKs
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Build/Resources/Constants.cs | Adds the NetCoreSdkRoot constant following existing patterns |
| src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs | Implements fallback logic: tries NetCoreSdkRoot first, then falls back to deriving from RuntimeIdentifierGraphPath for older SDKs |
baronfel
approved these changes
Feb 2, 2026
Member
baronfel
left a comment
There was a problem hiding this comment.
It would be good if copilot updated the existing tests to show this working end to end, but it's small enough to take on its face IMO.
Copilot AI
pushed a commit
that referenced
this pull request
Feb 3, 2026
The property got added with dotnet/sdk@e0c4dda The `RuntimeIdentifierGraphPath` property isn't guaranteed to point to a file inside a directory that contains the msbuild assemblies as customers sometimes set that to a custom .json file (i.e. new RID).
JanProvaznik
pushed a commit
to JanProvaznik/msbuild
that referenced
this pull request
Feb 25, 2026
The property got added with dotnet/sdk@e0c4dda The `RuntimeIdentifierGraphPath` property isn't guaranteed to point to a file inside a directory that contains the msbuild assemblies as customers sometimes set that to a custom .json file (i.e. new RID).
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.
The property got added with dotnet/sdk@e0c4dda
The
RuntimeIdentifierGraphPathproperty isn't guaranteed to point to a file inside a directory that contains the msbuild assemblies as customers sometimes set that to a custom .json file (i.e. new RID).