Automatic dependency submission (NuGet) cannot be used on a .NET monorepo: .slnx, 20-project cap, non-root manifests, and preview SDKs #205793
Replies: 2 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
the silent |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Product Feedback
💬 Feature/Topic Area
Supply chain security
Discussion Details
We want Dependabot alerts (not PRs) for the NuGet dependencies of a public .NET monorepo. The static dependency graph cannot provide them because the repository uses Central Package Management, and the recommended replacement, automatic dependency submission, cannot run on this repository for four independent reasons.
Repository shape
.csprojfiles undersrc/.src/Directory.Packages.props; noPackageReferencecarries aVersion..slnxfiles undersrc/(e.g.src/All.slnx). The repository root contains onlyglobal.jsonandnuget.config.global.jsonpins11.0.100-preview.6.26359.118withrollForward: latestMinor.dependabot.yml; version-update PRs are not wanted.Why the static dependency graph is not enough
The SBOM for this repository lists 157 NuGet packages, 8 of them with a version. The static parser reads
.csprojfiles and does not resolve versions fromDirectory.Packages.props, so nothing can match an advisory. This is the behavior reported in Dependency graph does not find NuGet package versions when using Central Package Management and in dependabot/dependabot-core#10772, where the dependency graph team's answer (2026-03-11) is to use automatic dependency submission.Why automatic dependency submission cannot run here
The observations below come from the run log of the generated
Automatic Dependency Submission (NuGet)workflow and from the automatic dependency submission reference.Trigger requires a root-level manifest or a
dependabot.ymlnugetentry. The supported list is.sln,.csproj,packages.config,.vbproj,.vcxproj, and.fsproj;.slnxis not included, and this repository has none of them at the root. Adding adependabot.ymlnugetentry only to satisfy the trigger creates a version-update job that we do not want, even withopen-pull-requests-limit: 0.Project discovery ignores
.slnxand stops after 20 files. The generatedvalidate-projectstep runs:project_files=$(find . -type f \( -name "*.csproj" -o -name "*.sln" -o -name "*.vbproj" -o -name "*.vcxproj" -o -name "*.fsproj" \) | grep -v '/obj/' | grep -v '/bin/' | head -20)and then runs
dotnet restoreon each result. On a repository with 350 project files this restores 20 of them, socomponent-detectionfindsproject.assets.jsonfor 20 projects and the submitted snapshot silently covers a fraction of the dependency tree. The step summary reports the files it found but not that the list was truncated.SDK support is documented as .NET 8.x, 9.x, and 10.x only. The workflow checks for a root
global.jsonand otherwise installs8.0.x,9.0.x, and10.0.x. The documentation does not say whether aglobal.jsonthat pins a preview SDK (here .NET 11 preview 6) is honored, and there is no way to find out short of enabling the feature and reading the failed run.Restore runs per project file, not per solution. Even without the cap, restoring 350 projects one at a time is far slower than
dotnet restore src/All.slnx, and there is no way to point the workflow at a solution or exclude directories (the only configuration is the on/off toggle).Requests
.slnxto both the trigger list and thefindpattern.head -20cap, or emit a warning when it truncates, and let repositories configure the restore entry points (solution or project paths) and directory exclusions.global.json, including preview versions, and document it.PackageVersionentries fromDirectory.Packages.propsin the static dependency graph, which would remove the need for a restore-based submission on CPM repositories altogether.Drafted by Claude (Anthropic AI assistant).
All reactions