Inspect NuGet Package Dependencies Without Restoring a Project
On this page
A package review can go wrong before anyone opens a DLL: someone reads a dependency name in a .nuspec and assumes that library is inside the download. Another person sees an empty dependency group and assumes the package works without a runtime. Both conclusions skip the distinction between package declarations, packaged files and a restored application.
Here we inspect Microsoft’s actual System.Text.Json 10.0.0 package, compare its framework groups, and check every reported dependency and ZIP member independently. No restore, project build or package code execution is needed. This is a package review, rather than the assembly metadata workflow.
We tested REA 6.10.1 with Node 26.12.1 and Python 3.14 on macOS arm64. REA requires Node ^22.23.4 || ^24.22.1 || >=26.12.1. The commands assume rea --version reports 6.10.1; see the setup guide.
Identify the package bytes before reading its dependencies
Use a fixed package version from NuGet’s official flat-container endpoint. Downloading it does contact the feed; the inspection that follows reads only the local file.
mkdir nuget-review
cd nuget-review
curl -fL https://api.nuget.org/v3-flatcontainer/system.text.json/10.0.0/system.text.json.10.0.0.nupkg -o package.nupkg
shasum -a 256 package.nupkg
rea inspect-nuget-nupkg package.nupkg --json > package.json
The download was 2,237,704 bytes, SHA-256 67200c213df240325acd800e6c0957992706b21183f4c55981898ba87c880aad. This is a digest we calculated, not a NuGet signature-verification result. The command reads package metadata and inventories ZIP names without extracting or running the assemblies.
Compare the target-framework dependency groups
python3 - <<'CHECK'
import json
r = json.load(open('package.json'))['normalized_result']
print(r['identity']['id'], r['identity']['version'])
print(r['artifact'])
print(r['coverage'])
for group in r['dependency_groups']:
print(group['target_framework'], len(group['dependencies']))
for dep in group['dependencies']:
print(' ', dep['id'], dep['version'], dep['exclude'])
CHECK
The identity is System.Text.Json 10.0.0. REA found five groups: .NETFramework4.6.2 declares eight dependencies, net8.0 two, net9.0 two, net10.0 none, and .NETStandard2.0 seven. These are the strings in the manifest, not the output of framework compatibility selection.
For net8.0, the declarations are System.IO.Pipelines and System.Text.Encodings.Web, each with version text 10.0.0 and exclude: Build,Analyzers. That exclusion belongs to those dependency declarations. It does not mean this package has no analyzers of its own.
The empty net10.0 group is a useful counterexample. It means the selected group contains no package-dependency declarations. It does not mean the DLL has no assembly references, that an application needs no shared framework, or that every project would select that group. REA does not perform NuGet restore or resolve version ranges. In particular, the recorded text 10.0.0 is not evidence of the exact version installed in a consuming application.
Cross-check the manifest and ZIP with Python
Instead of trusting a nicely formatted table, compare it with the .nuspec inside the same downloaded archive. Python’s standard library is enough for this check:
python3 - <<'CHECK'
import json, zipfile, xml.etree.ElementTree as ET
r = json.load(open('package.json'))['normalized_result']
with zipfile.ZipFile('package.nupkg') as z:
root = ET.fromstring(z.read(r['nuspec']['path']))
ns = {'n': root.tag.split('}')[0].strip('{')}
actual = []
for group in root.findall('n:metadata/n:dependencies/n:group', ns):
actual.append((group.get('targetFramework'), [
(d.get('id'), d.get('version'), d.get('exclude')) for d in group
]))
observed = [(g['target_framework'], [(d['id'], d['version'], d['exclude'])
for d in g['dependencies']]) for g in r['dependency_groups']]
assert actual == observed
members = {i.filename: i.file_size for i in z.infolist() if not i.is_dir()}
assert members == {i['path']: i['uncompressed_size'] for i in r['contents']}
print('All dependency declarations and ZIP members agree')
CHECK
Both assertions passed in our run. All five groups, dependency IDs, version strings and exclusions matched the XML in order. Every reported file name and expanded size matched the ZIP directory. The coverage was complete, with 66 file members and a 3,543-byte manifest selected through an OPC relationship.
This verifies the reader’s output against the input container. It is not a signature check, a vulnerability scan or a proof that the publisher’s metadata is correct. Keep the original package and digest so another reviewer can repeat the comparison.
Separate packaged DLLs from declared dependencies
python3 - <<'CHECK'
import json
r = json.load(open('package.json'))['normalized_result']
for item in r['contents']:
if item['path'].startswith('lib/') and item['path'].endswith('.dll'):
print(item['path'], item['uncompressed_size'])
print('Bundled dependency DLLs:', [x['path'] for x in r['contents']
if x['path'].endswith('/System.IO.Pipelines.dll')])
print('Analyzer files:', sum(x['role'] == 'analyzers' for x in r['contents']))
CHECK
The package contains five main library DLLs: lib/net10.0/System.Text.Json.dll (649,488 bytes), lib/net462/System.Text.Json.dll (777,480), lib/net8.0/System.Text.Json.dll (676,104), lib/net9.0/System.Text.Json.dll (649,480), and lib/netstandard2.0/System.Text.Json.dll (767,240). It also contains analyzer assemblies and other files.
The query for System.IO.Pipelines.dll returns an empty list even though four of the groups above declare a dependency on that package. The dependency is a request for restore to resolve separately; it is not a nested copy of the dependency DLL. A package’s ZIP contents and its dependency list answer different questions.
Folder-derived roles such as lib and analyzers describe package layout. They are not proof that a particular project will load or execute every file in that folder. For actual selection, inspect the consuming project’s restore artifacts, such as project.assets.json; preserve the selected target, package versions and asset paths. This walkthrough does not generate those artifacts or claim that restore succeeded.
Keep the review scoped to what was observed
A practical handoff has the .nupkg digest, identity, raw framework group, dependency strings and exclusions, the file inventory, and REA’s coverage and limitations. If someone asks whether a deployed app includes a vulnerable dependency, use its resolved dependency and deployment records next. Package metadata alone cannot answer that question.
REA’s default input allowance is 64 MiB and its default ZIP-entry allowance is 4,096. These are reader resource policies, not NuGet package-format limits. If a budget refuses the file, keep the refusal and decide whether a deliberate larger allowance is appropriate; a failed inventory is not an empty package.
Sources: REA 6.10.1 release, official System.Text.Json 10.0.0 package, and Microsoft’s dependency-group reference.