Closes#461. Requested by the platform session; stage only.
Problem
SDK-style projects without packages.lock.json or obj/project.assets.json listed only their direct packages.
Each such project was its own "Nicht ausgeführt" entry.
Approach: no dotnet restore
dotnet restore evaluates the repository's MSBuild files, which can run arbitrary code (targets hooked into restore). So instead of running it, sbom/nuget_resolve.rs resolves the graph from nuget.org's catalog entries: their dependencyGroups per target framework.
NuGet's own rules:
a direct reference fixes its version;
a dependency takes the lower bound of its range, and the highest bound among cousins.
Framework matching: the dependency group nearest the project's framework applies.
.NET Framework ↔ .NET Framework or .NET Standard (net461+ → 2.0, net46 → 1.3, net451 → 1.2, net45 → 1.1);
.NET / Core ↔ .NET / Core or .NET Standard (≥ 3.0 → 2.1);
the framework-free group applies everywhere.
Project frameworks come from TargetFramework(s) or TargetFrameworkVersion. A multi-targeting project is resolved for each framework, and the results are combined.
the guarded nuget.org registry, with a shared catalog() fetch (the licence lookup now uses it too);
nuget.config/packageSourceMapping is honoured: an id routed to another feed is never asked about, including direct references;
capped at 400 lookups and 90 s per scan.
Result:
A project counts as resolved only when its whole graph was answered.
Everything found is in the SBOM, with evidence <project> (transitive, nuget.org). Licences are filled by the existing lookup.
The rest remain a gap, now one sbom_dependencies entry naming all such projects (A.csproj, B.csproj and N more).
packages.config: nothing to resolve; the file already lists every installed package, transitive ones included.
Switch NUGET_TRANSITIVE_RESOLVE: on by default, off with APP_ENV=production until tested on stage. Stage runs it now.
Tests
Fake nuget.org:
framework group choice (net48 takes the Framework group, not netstandard2.1);
lowest applicable version;
direct pin wins;
a missing package leaves the project unresolved but keeps what was found;
a private feed sends nothing.
Framework and range parsing; version order; the aggregated gap (singular/plural wording).
#[ignore] test against the real nuget.org: Serilog.Sinks.File 5.0.0 on net48 resolves to Serilog 2.10.0, as the package's own net45 group says.
fmt and clippy -D warnings. Agent lib: 705 tests.
To check on stage
Check 16 in docs/release/staging-test-plan-after-v0.4.5.md. Upload an SDK-style net48 project referencing Serilog.Sinks.File 5.0.0 without a lockfile. Expect:
Serilog 2.10.0 in the SBOM, with evidence "transitive, nuget.org";
a project on a private feed stays in one aggregated "Nicht ausgeführt" entry;
log: transitive NuGet packages resolved from nuget.org.
Closes #461. Requested by the platform session; stage only.
## Problem
- SDK-style projects without `packages.lock.json` or `obj/project.assets.json` listed only their direct packages.
- Each such project was its own "Nicht ausgeführt" entry.
## Approach: no `dotnet restore`
`dotnet restore` evaluates the repository's MSBuild files, which can run arbitrary code (targets hooked into restore). So instead of running it, `sbom/nuget_resolve.rs` resolves the graph from **nuget.org's catalog entries**: their `dependencyGroups` per target framework.
**NuGet's own rules:**
- a direct reference fixes its version;
- a dependency takes the lower bound of its range, and the highest bound among cousins.
**Framework matching:** the dependency group nearest the project's framework applies.
- .NET Framework ↔ .NET Framework or .NET Standard (net461+ → 2.0, net46 → 1.3, net451 → 1.2, net45 → 1.1);
- .NET / Core ↔ .NET / Core or .NET Standard (≥ 3.0 → 2.1);
- the framework-free group applies everywhere.
- Project frameworks come from `TargetFramework(s)` or `TargetFrameworkVersion`. A multi-targeting project is resolved for each framework, and the results are combined.
**Egress, as in #467:**
- the guarded nuget.org registry, with a shared `catalog()` fetch (the licence lookup now uses it too);
- `nuget.config`/`packageSourceMapping` is honoured: an id routed to another feed is never asked about, including direct references;
- capped at 400 lookups and 90 s per scan.
**Result:**
- A project counts as **resolved** only when its whole graph was answered.
- Everything found is in the SBOM, with evidence `<project> (transitive, nuget.org)`. Licences are filled by the existing lookup.
- The rest remain a gap, now **one `sbom_dependencies` entry** naming all such projects (`A.csproj, B.csproj and N more`).
- **`packages.config`:** nothing to resolve; the file already lists every installed package, transitive ones included.
- **Switch `NUGET_TRANSITIVE_RESOLVE`:** on by default, **off with `APP_ENV=production`** until tested on stage. Stage runs it now.
## Tests
- Fake nuget.org:
- framework group choice (net48 takes the Framework group, not netstandard2.1);
- lowest applicable version;
- direct pin wins;
- a missing package leaves the project unresolved but keeps what was found;
- a private feed sends nothing.
- Framework and range parsing; version order; the aggregated gap (singular/plural wording).
- `#[ignore]` test against the **real nuget.org**: Serilog.Sinks.File 5.0.0 on net48 resolves to Serilog 2.10.0, as the package's own net45 group says.
- fmt and clippy `-D warnings`. Agent lib: 705 tests.
## To check on stage
Check 16 in `docs/release/staging-test-plan-after-v0.4.5.md`. Upload an SDK-style net48 project referencing Serilog.Sinks.File 5.0.0 without a lockfile. Expect:
- `Serilog 2.10.0` in the SBOM, with evidence "transitive, nuget.org";
- a project on a private feed stays in one aggregated "Nicht ausgeführt" entry;
- log: `transitive NuGet packages resolved from nuget.org`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
Closes#461. SDK-style projects without packages.lock.json or
obj/project.assets.json named only their direct packages, and each was
its own "Nicht ausgeführt" entry.
- sbom/nuget_resolve.rs resolves the transitive graph from nuget.org's
catalog entries (dependencyGroups per target framework) with NuGet's
rules: a direct reference fixes its version, a dependency takes its
range's lower bound, the highest of several; the dependency group
nearest the project's framework applies (.NET Framework, .NET/.NET
Core, .NET Standard incl. the Framework→Standard map, framework-free).
Frameworks from TargetFramework(s) or TargetFrameworkVersion.
- No dotnet restore: it evaluates the repository's MSBuild files, which
can run code. Requests go through the guarded nuget.org registry of
#467 (shared catalog() fetch), honour nuget.config/packageSourceMapping
(an id routed to another feed is never asked about, direct ones
included), and are capped (400 lookups, 90 s per scan).
- A project counts as resolved only when every package of its graph was
answered; the rest stay a gap, now ONE sbom_dependencies entry naming
all such projects ("A.csproj, B.csproj and N more"). What was found is
in the SBOM either way, with evidence "<project> (transitive,
nuget.org)"; licences are filled by the existing lookup.
- packages.config projects need nothing: the file lists every installed
package, transitive ones included.
- Switch NUGET_TRANSITIVE_RESOLVE: on by default, off with
APP_ENV=production until tested on stage.
- Tests: fake nuget.org (framework group choice, lowest applicable,
direct pin, missing package, private feed), framework/range parsing,
the aggregated gap; an ignored test against the real nuget.org
(Serilog.Sinks.File 5.0.0 on net48 → Serilog 2.10.0) passes.
- Docs (dotnet DE/EN); staging test plan: check 16.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit d7ab09f634 into main2026-10-06 09:07:36 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #461. Requested by the platform session; stage only.
Problem
packages.lock.jsonorobj/project.assets.jsonlisted only their direct packages.Approach: no
dotnet restoredotnet restoreevaluates the repository's MSBuild files, which can run arbitrary code (targets hooked into restore). So instead of running it,sbom/nuget_resolve.rsresolves the graph from nuget.org's catalog entries: theirdependencyGroupsper target framework.NuGet's own rules:
Framework matching: the dependency group nearest the project's framework applies.
TargetFramework(s)orTargetFrameworkVersion. A multi-targeting project is resolved for each framework, and the results are combined.Egress, as in #467:
catalog()fetch (the licence lookup now uses it too);nuget.config/packageSourceMappingis honoured: an id routed to another feed is never asked about, including direct references;Result:
<project> (transitive, nuget.org). Licences are filled by the existing lookup.sbom_dependenciesentry naming all such projects (A.csproj, B.csproj and N more).packages.config: nothing to resolve; the file already lists every installed package, transitive ones included.NUGET_TRANSITIVE_RESOLVE: on by default, off withAPP_ENV=productionuntil tested on stage. Stage runs it now.Tests
#[ignore]test against the real nuget.org: Serilog.Sinks.File 5.0.0 on net48 resolves to Serilog 2.10.0, as the package's own net45 group says.-D warnings. Agent lib: 705 tests.To check on stage
Check 16 in
docs/release/staging-test-plan-after-v0.4.5.md. Upload an SDK-style net48 project referencing Serilog.Sinks.File 5.0.0 without a lockfile. Expect:Serilog 2.10.0in the SBOM, with evidence "transitive, nuget.org";transitive NuGet packages resolved from nuget.org.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p