Repository navigation
[release/11.0.1xx-preview5] Source code updates from nuget/nuget.client - #6928
Conversation
|
Note PRs from original repository included in this codeflow update:
💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance. |
|
Note PRs from original repository included in this codeflow update: 💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance. |
…7406 NuGet/NuGet.Client PR #7406 ("Enable nullable for NuGet.Protocol repository abstractions") changed SourceRepository.GetResourceAsync<T> to return Task<T?>, matching the long-standing XML doc contract ("Null if the resource does not exist"). Consumers in sdk's TemplateEngine NuGet helpers were storing the result in non-nullable locals and dereferencing immediately, producing CS8600/CS8602 under nullable-enabled compilation with TreatWarningsAsErrors=true. Mirror the same pattern nuget.client now uses internally (SourceRepository.GetFeedType): throw InvalidOperationException if a provider cannot produce the requested resource, then proceed with a non-null value. Fixed 4 call sites across 2 files: src/Cli/Microsoft.TemplateEngine.Cli/NuGet/NugetApiManager.cs - GetResourceAsync<PackageMetadataResource> - GetResourceAsync<PackageSearchResource> test/TemplateEngine/Microsoft.TemplateEngine.TestHelper/PackageManager.cs - GetResourceAsync<FindPackageByIdResource> - GetResourceAsync<PackageMetadataResource> Co-authored-by: Copilot <[email protected]>
|
Pushed a fix for the nullability errors caused by nuget/nuget.client#7406, which flipped |
Repository.GetResource<T>() is now annotated to return T? (matching the documented null-on-missing behavior). The TemplateSearch.TemplateDiscovery tool dereferences the result and stores it in a non-nullable field, so the build fails with CS8600/CS8602/CS8618. Throw InvalidOperationException when the source does not provide the requested resource, matching the pattern used in NugetApiManager.cs and PackageManager.cs (and mirroring nuget.client's own internal SourceRepository.GetFeedType adoption). Co-authored-by: Copilot <[email protected]>
|
Additional fix: |
…#7406 GetResourceAsync<PackageMetadataResource> now returns Task<T?> — add null check with InvalidOperationException, matching the pattern used elsewhere. Co-authored-by: Copilot <[email protected]>
d1cf04e
into
release/11.0.1xx-preview5
Note
This is a codeflow update. It may contain both source code changes from
the source repo
as well as dependency updates. Learn more here.
This pull request brings the following source code changes
From https://github.com/nuget/nuget.client
Diff the source with this PR branch