Skip to content

Allow null SdkResult from SdkResolver.Resolve#13197

Merged
rainersigwald merged 1 commit intodotnet:mainfrom
rainersigwald:better-sdkresolver-nullability
Feb 4, 2026
Merged

Allow null SdkResult from SdkResolver.Resolve#13197
rainersigwald merged 1 commit intodotnet:mainfrom
rainersigwald:better-sdkresolver-nullability

Conversation

@rainersigwald
Copy link
Copy Markdown
Member

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 #13157.

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).
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 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.Resolve return type nullable (SdkResult?) to match documented behavior
  • Minor documentation formatting cleanup (removed extra blank lines)

@rainersigwald rainersigwald self-assigned this Feb 4, 2026
@rainersigwald rainersigwald enabled auto-merge (squash) February 4, 2026 15:18
@rainersigwald rainersigwald merged commit 4378e2a into dotnet:main Feb 4, 2026
15 checks passed
@rainersigwald rainersigwald deleted the better-sdkresolver-nullability branch February 4, 2026 16:50
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.
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.

4 participants