Allow null SdkResult from SdkResolver.Resolve#13197
Merged
rainersigwald merged 1 commit intodotnet:mainfrom Feb 4, 2026
Merged
Allow null SdkResult from SdkResolver.Resolve#13197rainersigwald merged 1 commit intodotnet:mainfrom
rainersigwald merged 1 commit intodotnet:mainfrom
Conversation
The doc comment explicitly mentions returning null and the SDK can do so, which caused a break in dotnet/dotnet#4579: src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver\WorkloadSdkResolver.cs(35,36): error CS8764: Nullability of return type doesn't match overridden member (possibly because of nullability attributes).
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a nullability mismatch in the SdkResolver.Resolve method signature by making the return type nullable. The documentation explicitly states that resolvers can return null when not applicable for a particular SDK reference, but the signature didn't reflect this. This change aligns the API signature with both its documentation and actual usage, fixing a compilation error in dotnet/dotnet#4579.
Changes:
- Made
SdkResolver.Resolvereturn type nullable (SdkResult?) to match documented behavior - Minor documentation formatting cleanup (removed extra blank lines)
baronfel
approved these changes
Feb 4, 2026
ViktorHofer
approved these changes
Feb 4, 2026
JanProvaznik
pushed a commit
to JanProvaznik/msbuild
that referenced
this pull request
Feb 25, 2026
The doc comment explicitly mentions returning null and the SDK can do so, which caused a break in dotnet/dotnet#4579: src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver\WorkloadSdkResolver.cs(35,36): error CS8764: Nullability of return type doesn't match overridden member (possibly because of nullability attributes). Follow up to dotnet#13157 / 0172c58.
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 doc comment explicitly mentions returning null and the SDK can do
so, which caused a break in dotnet/dotnet#4579:
Follow up to #13157.