Skip to content

Respect NetCoreSdkRoot property for TaskHostParameters#13176

Merged
ViktorHofer merged 1 commit intomainfrom
NetCoreSdkRoot
Feb 2, 2026
Merged

Respect NetCoreSdkRoot property for TaskHostParameters#13176
ViktorHofer merged 1 commit intomainfrom
NetCoreSdkRoot

Conversation

@ViktorHofer
Copy link
Copy Markdown
Member

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).

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).
Copilot AI review requested due to automatic review settings February 2, 2026 13:22
@ViktorHofer ViktorHofer changed the title Respect NetCoreSdkRoot property in TaskHostParameters Respect NetCoreSdkRoot property for TaskHostParameters Feb 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NetCoreSdkRoot constant for the new property name
  • Updates task host parameter logic to prefer NetCoreSdkRoot with fallback to RuntimeIdentifierGraphPath for 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

Copy link
Copy Markdown
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ViktorHofer ViktorHofer merged commit 7744bc9 into main Feb 2, 2026
15 checks passed
@ViktorHofer ViktorHofer deleted the NetCoreSdkRoot branch February 2, 2026 17:01
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants