Skip to content

Fix nullability compiler errors from NuGet 7.6 API changes#53489

Merged
ViktorHofer merged 2 commits intodarc-main-42f55340-3bb4-4b0f-9661-026bcf6564d1from
copilot/sub-pr-53350
Mar 17, 2026
Merged

Fix nullability compiler errors from NuGet 7.6 API changes#53489
ViktorHofer merged 2 commits intodarc-main-42f55340-3bb4-4b0f-9661-026bcf6564d1from
copilot/sub-pr-53350

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

NuGet 7.6.0-rc.16321 added nullable annotations to IPackageSearchMetadata.LicenseMetadata (LicenseMetadata?) and LicenseMetadata.LicenseExpression (NuGetLicenseExpression?), causing CS8602 errors in FakeItEasy mock chain expressions in TemplatePackageCoordinatorTests.cs.

Change

Added null-forgiving operators to the four affected mock setup expressions:

// Before
A.CallTo(() => searchMetadata.LicenseMetadata.LicenseExpression.ToString()).Returns("MIT");

// After
A.CallTo(() => searchMetadata.LicenseMetadata!.LicenseExpression!.ToString()).Returns("MIT");

Consistent with the companion fix already applied in NugetApiManager.cs (backflow commit) which used ?. when reading LicenseExpression in production code.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dev.azure.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
    • Triggering command: /usr/bin/curl curl -s REDACTED bash --no�� --noprofile adManifestReader/Microsoft.NET.Sdk.WorkloadManifestReader.csproj de/node/bin/grep (dns block)
    • Triggering command: /usr/bin/curl curl -v REDACTED bash --no�� semblies\|ComputeWasmBuildAssets et-format/dotnet-format.csproj de/node/bin/grep k/sdk/sdk/src/Webash nAndConfigFiles.--norc k/sdk/sdk/src/Wo--noprofile k/sdk/sdk/src/Workloads/Manifest/home/REDACTED/work/sdk/sdk/src/Dotnet.Watch/Watch.Aspire/Microsoft.DotNet.HotReload.Watch.Aspire.csproj k/sd�� k/sdk/sdk/src/Layout/redist/redist.csproj loadAgent.Data/Microsoft.DotNet.HotReload.Agent.Data.Package.csproj (dns block)
  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh pr checks 53350 --repo dotnet/sdk rapper/Microsoft.DotNet.NativeWrapper.csproj de/node/bin/grep .Tool.csproj .NetAnalyzers.cs--no-pager (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] [main] Update source code from dotnet/dotnet Fix nullability compiler errors from NuGet 7.6 API changes Mar 16, 2026
Copilot AI requested a review from ViktorHofer March 16, 2026 23:37
@ViktorHofer ViktorHofer marked this pull request as ready for review March 17, 2026 08:02
@ViktorHofer ViktorHofer requested a review from a team as a code owner March 17, 2026 08:02
@ViktorHofer ViktorHofer merged commit 83d346c into darc-main-42f55340-3bb4-4b0f-9661-026bcf6564d1 Mar 17, 2026
3 of 5 checks passed
@ViktorHofer ViktorHofer deleted the copilot/sub-pr-53350 branch March 17, 2026 08:02
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.

2 participants