From 76316b0ce53677218759dfa15aa1374a8dbe2a10 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 Aug 2025 17:29:54 +0000 Subject: [PATCH 1/6] Initial plan From c2627c228a3e696c43e0adde15bb213d6b12297c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 Aug 2025 17:39:10 +0000 Subject: [PATCH 2/6] Add breaking change documentation for NuGet packages excluded from deps.json files Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- docs/core/compatibility/10.0.md | 6 +++ .../10.0/deps-json-trimmed-packages.md | 47 +++++++++++++++++++ docs/core/compatibility/toc.yml | 4 ++ 3 files changed, 57 insertions(+) create mode 100644 docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index 4aeef9dd0abcf..523c62baf1125 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -34,6 +34,12 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af |--------------------------------------------------------------------------------|-------------------|--------------------| | [Default .NET images use Ubuntu](containers/10.0/default-images-use-ubuntu.md) | Behavioral change | Preview 1 | +## Deployment + +| Title | Type of change | Introduced version | +|-------|-------------------|--------------------| +| [NuGet packages may not be included in deps.json files if no runtime assets were included from the package](deployment/10.0/deps-json-trimmed-packages.md) | Source incompatible | Preview 5 | + ## Core .NET libraries | Title | Type of change | Introduced version | diff --git a/docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md b/docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md new file mode 100644 index 0000000000000..f3d3b3ff9ba15 --- /dev/null +++ b/docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md @@ -0,0 +1,47 @@ +--- +title: "Breaking change: NuGet packages may not be included in deps.json files if no runtime assets were included from the package" +description: "Learn about the breaking change in .NET 10 where NuGet packages that don't contribute runtime assets may be excluded from deps.json files." +ms.date: 08/27/2025 +ai-usage: ai-assisted +ms.custom: https://github.com/dotnet/docs/issues/48132 +--- +# NuGet packages may not be included in deps.json files if no runtime assets were included from the package + +NuGet packages or other libraries may now be excluded from the deps.json file if they don't contribute any runtime assets and removing them wouldn't cause dependency resolution issues. + +## Version introduced + +.NET 10 Preview 5 + +## Previous behavior + +Previously, all referenced NuGet packages and projects would be included in the deps.json file as library entries, even if there were no assets used from them. + +## New behavior + +NuGet packages or other libraries may be excluded from the deps.json file if: + +- They don't contribute any runtime assets +- Removing the library from the deps.json would not cause any libraries which do contribute runtime assets to no longer have a dependency path to them. + +## Type of breaking change + +This change can affect [source compatibility](../../categories.md#source-compatibility). + +## Reason for change + +The deps.json file lists runtime dependencies and is used by the loader to load those dependencies. Some other tools also process the deps.json file. Including libraries that are not actually used is less accurate and can lead to false positives for security scanners that use the deps.json file if the file lists dependencies that are not actually used. + +## Recommended action + +To disable the new behavior, set the `TrimDepsJsonLibrariesWithoutAssets` MSBuild property to `false`: + +```xml + + false + +``` + +## Affected APIs + +None. diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 5e587e9139a61..d2eaa99cdb018 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -30,6 +30,10 @@ items: items: - name: Default .NET images use Ubuntu href: containers/10.0/default-images-use-ubuntu.md + - name: Deployment + items: + - name: NuGet packages may not be included in deps.json files if no runtime assets were included from the package + href: deployment/10.0/deps-json-trimmed-packages.md - name: Core .NET libraries items: - name: API obsoletions with non-default diagnostic IDs From a54799ffdcd43042a041032bc165c74bcae85b24 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 27 Aug 2025 11:10:14 -0700 Subject: [PATCH 3/6] human edits --- docs/core/compatibility/10.0.md | 2 +- .../10.0/deps-json-trimmed-packages.md | 18 +++++++++--------- docs/core/compatibility/toc.yml | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index 523c62baf1125..f1ecd66660b30 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -38,7 +38,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | Title | Type of change | Introduced version | |-------|-------------------|--------------------| -| [NuGet packages may not be included in deps.json files if no runtime assets were included from the package](deployment/10.0/deps-json-trimmed-packages.md) | Source incompatible | Preview 5 | +| [NuGet packages with no runtime assets aren't included in deps.json](deployment/10.0/deps-json-trimmed-packages.md) | Source incompatible | Preview 5 | ## Core .NET libraries diff --git a/docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md b/docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md index f3d3b3ff9ba15..58d86bb581934 100644 --- a/docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md +++ b/docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md @@ -1,13 +1,13 @@ --- -title: "Breaking change: NuGet packages may not be included in deps.json files if no runtime assets were included from the package" -description: "Learn about the breaking change in .NET 10 where NuGet packages that don't contribute runtime assets may be excluded from deps.json files." +title: "Breaking change: NuGet packages with no runtime assets aren't included in deps.json" +description: "Learn about the breaking change in .NET 10 where NuGet packages that don't contribute runtime assets might be excluded from deps.json files." ms.date: 08/27/2025 ai-usage: ai-assisted ms.custom: https://github.com/dotnet/docs/issues/48132 --- -# NuGet packages may not be included in deps.json files if no runtime assets were included from the package +# NuGet packages with no runtime assets aren't included in deps.json -NuGet packages or other libraries may now be excluded from the deps.json file if they don't contribute any runtime assets and removing them wouldn't cause dependency resolution issues. +NuGet packages or other libraries that don't contribute any runtime assets are now excluded from the deps.json file if removing them wouldn't cause dependency resolution issues. ## Version introduced @@ -15,14 +15,14 @@ NuGet packages or other libraries may now be excluded from the deps.json file if ## Previous behavior -Previously, all referenced NuGet packages and projects would be included in the deps.json file as library entries, even if there were no assets used from them. +Previously, all referenced NuGet packages and projects were included in the deps.json file as library entries, even if there were no assets used from them. ## New behavior -NuGet packages or other libraries may be excluded from the deps.json file if: +NuGet packages or other libraries might be excluded from the deps.json file if: -- They don't contribute any runtime assets -- Removing the library from the deps.json would not cause any libraries which do contribute runtime assets to no longer have a dependency path to them. +- They don't contribute any runtime assets. +- Removing the library from the deps.json would not cause any libraries that do contribute runtime assets to no longer have a dependency path to them. ## Type of breaking change @@ -30,7 +30,7 @@ This change can affect [source compatibility](../../categories.md#source-compati ## Reason for change -The deps.json file lists runtime dependencies and is used by the loader to load those dependencies. Some other tools also process the deps.json file. Including libraries that are not actually used is less accurate and can lead to false positives for security scanners that use the deps.json file if the file lists dependencies that are not actually used. +The deps.json file lists runtime dependencies and is used by the loader to load those dependencies. Some other tools also process the deps.json file. Including libraries that aren't actually used is less accurate and can lead to false positives for security scanners that use the deps.json file. ## Recommended action diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index d2eaa99cdb018..bb7a0a5662c42 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -32,7 +32,7 @@ items: href: containers/10.0/default-images-use-ubuntu.md - name: Deployment items: - - name: NuGet packages may not be included in deps.json files if no runtime assets were included from the package + - name: NuGet packages with no runtime assets aren't included in deps.json href: deployment/10.0/deps-json-trimmed-packages.md - name: Core .NET libraries items: @@ -830,7 +830,7 @@ items: href: core-libraries/6.0/system-drawing-common-windows-only.md - name: System.Security.SecurityContext is marked obsolete href: core-libraries/6.0/securitycontext-obsolete.md - - name: Task.FromResult may return singleton + - name: Task.FromResult might return singleton href: core-libraries/6.0/task-fromresult-returns-singleton.md - name: Unhandled exceptions from a BackgroundService href: core-libraries/6.0/hosting-exception-handling.md From 04200b6b9161299b86f976b0460a04d1a0755185 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 27 Aug 2025 11:16:17 -0700 Subject: [PATCH 4/6] move to correct area --- docs/core/compatibility/10.0.md | 7 +------ .../{deployment => sdk}/10.0/deps-json-trimmed-packages.md | 0 docs/core/compatibility/toc.yml | 6 ++---- 3 files changed, 3 insertions(+), 10 deletions(-) rename docs/core/compatibility/{deployment => sdk}/10.0/deps-json-trimmed-packages.md (100%) diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index f1ecd66660b30..fc4ed826430ea 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -34,12 +34,6 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af |--------------------------------------------------------------------------------|-------------------|--------------------| | [Default .NET images use Ubuntu](containers/10.0/default-images-use-ubuntu.md) | Behavioral change | Preview 1 | -## Deployment - -| Title | Type of change | Introduced version | -|-------|-------------------|--------------------| -| [NuGet packages with no runtime assets aren't included in deps.json](deployment/10.0/deps-json-trimmed-packages.md) | Source incompatible | Preview 5 | - ## Core .NET libraries | Title | Type of change | Introduced version | @@ -118,6 +112,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 | | [MSBuild custom culture resource handling](sdk/10.0/msbuild-custom-culture.md) | Behavioral change | Preview 1 | | [NU1510 is raised for direct references pruned by NuGet](sdk/10.0/nu1510-pruned-references.md) | Source incompatible | Preview 1 | +| [NuGet packages with no runtime assets aren't included in deps.json](sdk/10.0/deps-json-trimmed-packages.md) | Source incompatible | Preview 5 | | [PackageReference without a version raises an error](sdk/10.0/nu1015-packagereference-version.md) | Behavioral change | Preview 6 | | [PrunePackageReference marks direct prunable references with PrivateAssets=all and IncludeAssets=none](sdk/10.0/prune-packagereference-privateassets.md) | Behavioral change | Preview 7 | | [HTTP warnings promoted to errors in `dotnet package list` and `dotnet package search`](sdk/10.0/http-warnings-to-errors.md) | Behavioral/source incompatible change | Preview 4 | diff --git a/docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md b/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md similarity index 100% rename from docs/core/compatibility/deployment/10.0/deps-json-trimmed-packages.md rename to docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index bb7a0a5662c42..4a81877a15947 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -30,10 +30,6 @@ items: items: - name: Default .NET images use Ubuntu href: containers/10.0/default-images-use-ubuntu.md - - name: Deployment - items: - - name: NuGet packages with no runtime assets aren't included in deps.json - href: deployment/10.0/deps-json-trimmed-packages.md - name: Core .NET libraries items: - name: API obsoletions with non-default diagnostic IDs @@ -130,6 +126,8 @@ items: href: sdk/10.0/msbuild-custom-culture.md - name: NU1510 is raised for direct references pruned by NuGet href: sdk/10.0/nu1510-pruned-references.md + - name: NuGet packages with no runtime assets aren't included in deps.json + href: sdk/10.0/deps-json-trimmed-packages.md - name: PackageReference without a version raises error href: sdk/10.0/nu1015-packagereference-version.md - name: PrunePackageReference marks direct prunable references with PrivateAssets=all and IncludeAssets=none From 782b3ce53481ad71ea95fc1851ed7f3539f9397c Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 27 Aug 2025 11:31:20 -0700 Subject: [PATCH 5/6] add see also link --- .../core/compatibility/sdk/10.0/deps-json-trimmed-packages.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md b/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md index 58d86bb581934..57393ea90db53 100644 --- a/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md +++ b/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md @@ -45,3 +45,7 @@ To disable the new behavior, set the `TrimDepsJsonLibrariesWithoutAssets` MSBuil ## Affected APIs None. + +## See also + +- [Pruning of framework-provided package references](../../../whats-new/dotnet-10/sdk.md#pruning-of-framework-provided-package-references) From 676f93e2464c4185f7a177db2b086e1110d20b13 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 27 Aug 2025 12:49:44 -0700 Subject: [PATCH 6/6] Update docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md --- docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md b/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md index 57393ea90db53..4bd5b9aea9977 100644 --- a/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md +++ b/docs/core/compatibility/sdk/10.0/deps-json-trimmed-packages.md @@ -21,7 +21,7 @@ Previously, all referenced NuGet packages and projects were included in the deps NuGet packages or other libraries might be excluded from the deps.json file if: -- They don't contribute any runtime assets. +- They don't contribute any runtime assets, and - Removing the library from the deps.json would not cause any libraries that do contribute runtime assets to no longer have a dependency path to them. ## Type of breaking change