Implements support for Repo‑Local MSBuild SDKs via .msbuild/Sdk/<SdkName>/#13027
Open
ocalvo wants to merge 13 commits intodotnet:mainfrom
Open
Implements support for Repo‑Local MSBuild SDKs via .msbuild/Sdk/<SdkName>/#13027ocalvo wants to merge 13 commits intodotnet:mainfrom
ocalvo wants to merge 13 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements support for repository-local MSBuild SDKs by adding a new RepoLocalSdkResolver that searches for SDKs in a .msbuild/Sdk/<SdkName>/ directory within the repository root. This allows projects to use custom SDKs located within their repository without requiring global installation.
Changes:
- Added
RepoLocalSdkResolverclass that walks up the directory tree to find repository markers (.git, .hg, .svn) and searches for SDKs in.msbuild/Sdk/directory - Registered the new resolver in
SdkResolverLoaderwith higher priority (5000) thanDefaultSdkResolver(10000) to allow repo-local SDKs to override global ones - Added comprehensive unit tests covering various scenarios including success cases, failure cases, and edge cases
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Build/Microsoft.Build.csproj | Adds the new RepoLocalSdkResolver.cs file to the build |
| src/Build/BackEnd/Components/SdkResolution/SdkResolverLoader.cs | Updates both GetDefaultResolvers() and LoadAllResolvers() to include the new RepoLocalSdkResolver before DefaultSdkResolver |
| src/Build/BackEnd/Components/SdkResolution/RepoLocalSdkResolver.cs | New resolver implementation that finds repository root and searches for SDKs in .msbuild/Sdk/ directory |
| src/Build.UnitTests/BackEnd/RepoLocalSdkResolver_Tests.cs | Comprehensive test suite covering all major scenarios for the new resolver |
…r.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Author
|
@copilot open a new pull request to apply changes based on the comments in this thread |
This reverts commit bdc8f28.
This was referenced Apr 20, 2026
Closed
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 #13017
Context
Implements local repo Sdk resolution
Changes Made
Add new local Sdk resolver
Testing
Add new unit tests
Notes