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
Copy Markdown
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
Copy Markdown
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
akoeplinger pushed a commit that referenced this pull request Mar 27, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
(cherry picked from commit 83d346c)
dotnet-maestro bot added a commit that referenced this pull request Apr 3, 2026
[main] Source code updates from dotnet/dotnet


 - Update baselines

(cherry picked from commit 2fbadcb)

 - Fix nullability compiler errors from NuGet 7.6 API changes (#53489)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
(cherry picked from commit 83d346c)

 - Update baselines

(cherry picked from commit ca8b34c)

 - Update template engine error text expectations to match new output from sys.cl due to PR  dotnet/command-line-api#2747

(cherry picked from commit 9ebeea7)

 - Pin KnownWebAssemblySdkPack to runtime version in codeflow

When the codeflow updates MicrosoftNETCoreAppRuntimePackageVersion, the
WebAssembly.Pack version must also be pinned to match. Without this, the
workload manifest from the bootstrap SDK resolves an older pack version
that doesn't include changes from the incoming runtime (e.g. the
Framework SourceType fix from runtime#125329), causing
DiscoverPrecompressedAssets to crash on duplicate Identity keys in
multi-client Blazor WASM publish scenarios.

This mirrors the existing pattern for KnownILCompilerPack,
KnownILLinkPack, and KnownCrossgen2Pack.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

 - Update tests for incoming runtime and templating changes

- NativeAot: Account for 'lib' prefix on Unix native library outputs
  (runtime#124611 made this the default for non-Windows)
- dotnet-new: Update Verify snapshots for STJ error messages
  (templating#9956 migrated from Newtonsoft.Json to System.Text.Json,
  changing the corrupted JSON error text)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

 - Fix ILLink test to specify TrimmerRootAssembly by name instead of path

ILLink behavior changed to require root assemblies specified by assembly
name rather than file path. Update EnableNonFrameworkTrimming to use
$(AssemblyName) instead of @(IntermediateAssembly->'%(FullPath)').

 - Fix AOT test to set TrimmerSingleWarn on ResolvedFileToPublish instead of ManagedAssemblyToLink

The SetMetadata helper in It_can_show_single_warning_per_assembly was hooking
into PrepareForILLink and setting metadata on ManagedAssemblyToLink items. The
v11.0 ILLink package refactored shared trim configuration into a new
_PrepareTrimConfiguration target that runs earlier, and the AOT pipeline reads
from ResolvedFileToPublish (not ManagedAssemblyToLink). Hook into the public
ComputeResolvedFilesToPublishList target and set metadata on the correct item
type so per-assembly overrides are visible to the ILC compiler.

 - Merge branch 'main' into darc-main-d62159cf-592c-4fc3-b575-d4971159f3ff

 - Add FilterItemsByDuplicateHash task to InTree.targets

The task was still in use. The other two were removed in the vmr

 - Merge branch 'main' into darc-main-d62159cf-592c-4fc3-b575-d4971159f3ff

 - Manual dependency version update to latest build

 - Disable Publish_HostingMultipleBlazorWebApps_Works pending rebootstrap

The DiscoverPrecompressedAssets task fails with a duplicate key error.
The fix is merged in dotnet/runtime#126211 but requires a rebootstrap.

Tracking issue: #53689

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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