You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upgrading packages injected by a custom project SDK fails #794
Some MSBuild project SDKs add PackageReference items to the project without marking them as auto-referenced. dotnet-outdated reports these packages as direct dependencies. When you run -u, it tries to upgrade them with dotnet add package, which fails. The version comes from the SDK, not from the project file.
One example is Cake.Sdk, which injects Cake.Generator.
A second, smaller problem shows in the output above: the project is labelled Cake.Sdk instead of project-sdk.
Expected
Packages that come from an SDK should not be offered as separate upgrades. The fix is to upgrade the SDK itself. #793 adds support for that in project files, and #755 already does it for #:sdk in file-based apps. For file-based apps, the directives already replace the dependencies from the restore graph, so the injected packages are hidden there.
SDKs that mark their implicit packages as auto-referenced, such as Aspire.AppHost.Sdk, are not affected.
Possible approaches
Only report direct dependencies that come from a PackageReference, PackageVersion or GlobalPackageReference in the project file or its imported props files, or from a declared SDK.
Check whether the PackageReference was defined inside the SDK's own props or targets files, for example through MSBuild evaluation, and treat it as implicit.
Activity
Treat package references injected by custom SDKs as auto-referenced
Treat package references injected by custom SDKs as auto-referenced (d…