From 70998cf61fe79a8a595b0f1529428469294ea2d1 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 20 Nov 2025 22:29:24 +0000
Subject: [PATCH 01/17] Initial plan
From fc488dcbcfa429064079a870f9eb4815e6929a49 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 20 Nov 2025 22:34:14 +0000
Subject: [PATCH 02/17] Add multi-targeting section to trimming documentation
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
.../prepare-libraries-for-trimming.md | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 8185473604f72..a1841617ade10 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -90,6 +90,58 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
* Even if there were no API changes.
* Introducing trim analysis warnings is a breaking change when the library is used with `PublishTrimmed`.
+## Multi-targeting for trimming
+
+When preparing libraries for trimming, multi-targeting is essential because trimming is only supported in .NET 6 and later. Most libraries need to support earlier target frameworks like .NET Standard 2.0 or .NET Framework 4.7.2, which don't support trimming.
+
+### Common multi-targeting scenarios
+
+Libraries typically use one of these multi-targeting patterns:
+
+* Target only .NET Standard 2.0 or .NET Frameworkâthese frameworks don't support trimming.
+* Multi-target .NET Standard 2.0 and a modern .NET version (net6.0 or later).
+* Multi-target .NET Framework 4.7.2, .NET Standard 2.0, and a modern .NET version.
+
+For example, a library might use:
+
+```xml
+netstandard2.0;net8.0
+```
+
+Or:
+
+```xml
+net472;netstandard2.0;net8.0
+```
+
+### Enable IsTrimmable conditionally
+
+When multi-targeting, set `true` only for target frameworks that support trimming. Attempting to use `IsTrimmable` with .NET Standard or .NET Framework produces a warning because these frameworks don't have trim-compatibility annotations.
+
+Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable`:
+
+```xml
+
+ netstandard2.0;net8.0
+ true
+
+```
+
+This approach:
+
+* Enables `IsTrimmable` for `net8.0` and any future .NET versions compatible with `net6.0` or later.
+* Doesn't require updating the condition when you add new target frameworks.
+* Avoids warnings about using `IsTrimmable` with unsupported frameworks.
+
+### Recommendations for multi-targeting
+
+* Always multi-target to include a modern .NET version (net6.0 or later) when you prepare libraries for trimming.
+* Use conditional `IsTrimmable` to enable trimming analysis only for supported frameworks.
+* Create separate trimming test apps for each target framework that supports trimming if your library has framework-specific behavior.
+* Be aware that trim-compatibility work done for modern .NET versions doesn't apply to .NET Standard or .NET Framework builds of your library.
+
+For more information about the requirement to multi-target when using trimming, see [Trimming may not be used with .NET Standard or .NET Framework](../../compatibility/sdk/8.0/trimming-unsupported-targetframework.md).
+
## Resolve trim warnings
The preceding steps produce warnings about code that might cause problems when used in a trimmed app. The following examples show the most common warnings with recommendations for fixing them.
From 760f715985caff17cab1f0a5671ba03fd9ab0dc7 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 20 Nov 2025 22:35:48 +0000
Subject: [PATCH 03/17] Update ms.date metadata for document changes
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/trimming/prepare-libraries-for-trimming.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index a1841617ade10..782749d775011 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -3,7 +3,7 @@ title: Prepare .NET libraries for trimming
description: Learn how to prepare .NET libraries for trimming.
author: sbomer
ms.author: svbomer
-ms.date: 06/12/2023
+ms.date: 11/20/2025
---
# Prepare .NET libraries for trimming
From 14d335ccc7962125b8ebd6294eb753fbfdb4968d Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 2 Dec 2025 19:20:22 +0000
Subject: [PATCH 04/17] Simplify multi-targeting section per review feedback
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
.../prepare-libraries-for-trimming.md | 43 +------------------
1 file changed, 2 insertions(+), 41 deletions(-)
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 782749d775011..1e739def03b39 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -92,33 +92,7 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
## Multi-targeting for trimming
-When preparing libraries for trimming, multi-targeting is essential because trimming is only supported in .NET 6 and later. Most libraries need to support earlier target frameworks like .NET Standard 2.0 or .NET Framework 4.7.2, which don't support trimming.
-
-### Common multi-targeting scenarios
-
-Libraries typically use one of these multi-targeting patterns:
-
-* Target only .NET Standard 2.0 or .NET Frameworkâthese frameworks don't support trimming.
-* Multi-target .NET Standard 2.0 and a modern .NET version (net6.0 or later).
-* Multi-target .NET Framework 4.7.2, .NET Standard 2.0, and a modern .NET version.
-
-For example, a library might use:
-
-```xml
-netstandard2.0;net8.0
-```
-
-Or:
-
-```xml
-net472;netstandard2.0;net8.0
-```
-
-### Enable IsTrimmable conditionally
-
-When multi-targeting, set `true` only for target frameworks that support trimming. Attempting to use `IsTrimmable` with .NET Standard or .NET Framework produces a warning because these frameworks don't have trim-compatibility annotations.
-
-Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable`:
+When preparing libraries for trimming, we recommend multi-targeting to at least `net6.0` because that's the earliest TargetFramework where we support the trim analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
```xml
@@ -127,20 +101,7 @@ Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `
```
-This approach:
-
-* Enables `IsTrimmable` for `net8.0` and any future .NET versions compatible with `net6.0` or later.
-* Doesn't require updating the condition when you add new target frameworks.
-* Avoids warnings about using `IsTrimmable` with unsupported frameworks.
-
-### Recommendations for multi-targeting
-
-* Always multi-target to include a modern .NET version (net6.0 or later) when you prepare libraries for trimming.
-* Use conditional `IsTrimmable` to enable trimming analysis only for supported frameworks.
-* Create separate trimming test apps for each target framework that supports trimming if your library has framework-specific behavior.
-* Be aware that trim-compatibility work done for modern .NET versions doesn't apply to .NET Standard or .NET Framework builds of your library.
-
-For more information about the requirement to multi-target when using trimming, see [Trimming may not be used with .NET Standard or .NET Framework](../../compatibility/sdk/8.0/trimming-unsupported-targetframework.md).
+For more information, see [Trimming may not be used with .NET Standard or .NET Framework](../../compatibility/sdk/8.0/trimming-unsupported-targetframework.md).
## Resolve trim warnings
From 8621761efba3ad3b89eb2a31fbef4f76e5952328 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 2 Dec 2025 21:10:26 +0000
Subject: [PATCH 05/17] Clarify multi-targeting recommendation to avoid TFM
gaps
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
.../core/deploying/trimming/prepare-libraries-for-trimming.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 1e739def03b39..fc848c5be4233 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -92,11 +92,11 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
## Multi-targeting for trimming
-When preparing libraries for trimming, we recommend multi-targeting to at least `net6.0` because that's the earliest TargetFramework where we support the trim analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
+When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net6.0` to ensure that apps targeting `net6.0` or above get a version of your library that supports the trim analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
```xml
- netstandard2.0;net8.0
+ netstandard2.0;net6.0
true
```
From 78f6612b68863943a4060e3991651dc91a8dbab6 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 2 Dec 2025 21:49:20 +0000
Subject: [PATCH 06/17] Add multi-targeting note for IsAotCompatible
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/trimming/prepare-libraries-for-trimming.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index fc848c5be4233..95215462711bd 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -37,7 +37,7 @@ Setting the MSBuild property `IsTrimmable` to `true` marks the assembly as "trim
* Is considered compatible with trimming.
* Shouldn't generate trim-related warnings when building. When used in a trimmed app, the assembly has its unused members trimmed in the final output.
-The `IsTrimmable` property defaults to `true` when configuring a project as AOT-compatible with `true`. For more information, see [AOT-compatibility analyzers](../native-aot/index.md#aot-compatibility-analyzers).
+The `IsTrimmable` property defaults to `true` when configuring a project as AOT-compatible with `true`. For more information, see [AOT-compatibility analyzers](../native-aot/index.md#aot-compatibility-analyzers). When using `IsAotCompatible` in a multi-targeted project, apply the same multi-targeting guidance as for `IsTrimmable` (see [Multi-targeting for trimming](#multi-targeting-for-trimming)).
To generate trim warnings without marking the project as trim-compatible, use `true` rather than `true`.
From 0777ac184410c3af10689370bb1c89fb24496948 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 2 Dec 2025 21:56:00 +0000
Subject: [PATCH 07/17] Move IsAotCompatible multi-targeting guidance to AOT
docs
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 13 +++++++++++++
.../trimming/prepare-libraries-for-trimming.md | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index bb07bd14be2d8..e25b52f7fbe06 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -107,6 +107,19 @@ The preceding configuration assigns a default of `true` to the following propert
These analyzers help to ensure that a library is compatible with Native AOT.
+### Multi-targeting for AOT compatibility
+
+When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net6.0` to ensure that apps targeting `net6.0` or above get a version of your library that supports the AOT analyzers. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net6.0` and above:
+
+```xml
+
+ netstandard2.0;net6.0
+ true
+
+```
+
+For more information, see [Trimming may not be used with .NET Standard or .NET Framework](../../compatibility/sdk/8.0/trimming-unsupported-targetframework.md).
+
## Native debug information
By default, Native AOT publishing produces debug information in a separate file:
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 95215462711bd..fc848c5be4233 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -37,7 +37,7 @@ Setting the MSBuild property `IsTrimmable` to `true` marks the assembly as "trim
* Is considered compatible with trimming.
* Shouldn't generate trim-related warnings when building. When used in a trimmed app, the assembly has its unused members trimmed in the final output.
-The `IsTrimmable` property defaults to `true` when configuring a project as AOT-compatible with `true`. For more information, see [AOT-compatibility analyzers](../native-aot/index.md#aot-compatibility-analyzers). When using `IsAotCompatible` in a multi-targeted project, apply the same multi-targeting guidance as for `IsTrimmable` (see [Multi-targeting for trimming](#multi-targeting-for-trimming)).
+The `IsTrimmable` property defaults to `true` when configuring a project as AOT-compatible with `true`. For more information, see [AOT-compatibility analyzers](../native-aot/index.md#aot-compatibility-analyzers).
To generate trim warnings without marking the project as trim-compatible, use `true` rather than `true`.
From e033ba5ba7d964a1f5b50dcbb21344c3affedafa Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 2 Dec 2025 22:14:36 +0000
Subject: [PATCH 08/17] Update AOT docs and SDK errors to use net8.0 for AOT,
net6.0 for trimming
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 6 +++---
docs/core/tools/sdk-errors/index.md | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index e25b52f7fbe06..d8558d576c2ab 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -109,12 +109,12 @@ These analyzers help to ensure that a library is compatible with Native AOT.
### Multi-targeting for AOT compatibility
-When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net6.0` to ensure that apps targeting `net6.0` or above get a version of your library that supports the AOT analyzers. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net6.0` and above:
+When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net8.0` to ensure that apps targeting `net8.0` or above get a version of your library that supports the AOT analyzers. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
```xml
- netstandard2.0;net6.0
- true
+ netstandard2.0;net8.0
+ true
```
diff --git a/docs/core/tools/sdk-errors/index.md b/docs/core/tools/sdk-errors/index.md
index 2503ee2c236c2..83b74db46d8c6 100644
--- a/docs/core/tools/sdk-errors/index.md
+++ b/docs/core/tools/sdk-errors/index.md
@@ -370,7 +370,7 @@ This list is a complete list of the errors that you might get from the .NET SDK
|NETSDK1207|Ahead-of-time compilation is not supported for the target framework.|
|NETSDK1208|The target platform identifier {0} was not recognized. This is because MSBuildEnableWorkloadResolver is set to false which disables .NET SDK Workloads which is required for this identifier. Unset this environment variable or MSBuild property to enable workloads.|
|NETSDK1209|The current Visual Studio version does not support targeting {0} {1}. Either target {0} {2} or lower, or use Visual Studio version {3} or higher.|
-|NETSDK1210|IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example:
`true`|
|NETSDK1211|EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example:
`true`|
-|NETSDK1212|IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example:
`true`|
+|NETSDK1212|IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example:
`true`|
|NETSDK1213|Targeting .NET 8.0 or higher in Visual Studio 2022 17.7 is not supported.|
From c12765b8d8b421709ff55c7195ac61cdad09a529 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 4 Dec 2025 22:51:41 +0000
Subject: [PATCH 09/17] Recommend including latest .NET version for latest
analyzer
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 4 ++--
.../core/deploying/trimming/prepare-libraries-for-trimming.md | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index d8558d576c2ab..8f443017ec6ab 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -109,11 +109,11 @@ These analyzers help to ensure that a library is compatible with Native AOT.
### Multi-targeting for AOT compatibility
-When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net8.0` to ensure that apps targeting `net8.0` or above get a version of your library that supports the AOT analyzers. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
+When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net8.0` to ensure that apps targeting `net8.0` or above get a version of your library that supports the AOT analyzers. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
```xml
- netstandard2.0;net8.0
+ netstandard2.0;net8.0;net9.0
true
```
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index fc848c5be4233..a3bbbdcab9e63 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -92,11 +92,11 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
## Multi-targeting for trimming
-When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net6.0` to ensure that apps targeting `net6.0` or above get a version of your library that supports the trim analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
+When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net6.0` to ensure that apps targeting `net6.0` or above get a version of your library that supports the trim analyzer. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
```xml
- netstandard2.0;net6.0
+ netstandard2.0;net6.0;net9.0
true
```
From a46728e1248e247d5e83f84076f75ea7c4febb8e Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 4 Dec 2025 23:03:50 +0000
Subject: [PATCH 10/17] Use net10.0 as latest .NET version in examples
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 2 +-
docs/core/deploying/trimming/prepare-libraries-for-trimming.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index 8f443017ec6ab..d92692ac11c7e 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -113,7 +113,7 @@ When preparing libraries for AOT compatibility, if your library targets any fram
```xml
- netstandard2.0;net8.0;net9.0
+ netstandard2.0;net8.0;net10.0
true
```
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index a3bbbdcab9e63..3a0ff1082eb07 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -96,7 +96,7 @@ When preparing libraries for trimming, if your library targets any framework ear
```xml
- netstandard2.0;net6.0;net9.0
+ netstandard2.0;net6.0;net10.0
true
```
From 426364d407f6c4c6be3dd90e9d0af1aa298a11f0 Mon Sep 17 00:00:00 2001
From: Sven Boemer
Date: Wed, 10 Dec 2025 11:54:58 -0800
Subject: [PATCH 11/17] Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---
docs/core/tools/sdk-errors/index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/core/tools/sdk-errors/index.md b/docs/core/tools/sdk-errors/index.md
index 83b74db46d8c6..cf4e02e65e40b 100644
--- a/docs/core/tools/sdk-errors/index.md
+++ b/docs/core/tools/sdk-errors/index.md
@@ -370,7 +370,7 @@ This list is a complete list of the errors that you might get from the .NET SDK
|NETSDK1207|Ahead-of-time compilation is not supported for the target framework.|
|NETSDK1208|The target platform identifier {0} was not recognized. This is because MSBuildEnableWorkloadResolver is set to false which disables .NET SDK Workloads which is required for this identifier. Unset this environment variable or MSBuild property to enable workloads.|
|NETSDK1209|The current Visual Studio version does not support targeting {0} {1}. Either target {0} {2} or lower, or use Visual Studio version {3} or higher.|
-|NETSDK1210|IsAotCompatible and EnableAotAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable ahead-of-time compilation analysis, and set IsAotCompatible only for the supported frameworks. For example:
`true`|
|NETSDK1211|EnableSingleFileAnalyzer is not supported for the target framework. Consider multi-targeting to a supported framework to enable single-file analysis, and set EnableSingleFileAnalyzer only for the supported frameworks. For example:
`true`|
|NETSDK1212|IsTrimmable and EnableTrimAnalyzer are not supported for the target framework. Consider multi-targeting to a supported framework to enable trimming, and set IsTrimmable only for the supported frameworks. For example:
`true`|
|NETSDK1213|Targeting .NET 8.0 or higher in Visual Studio 2022 17.7 is not supported.|
From 603021d15b0d1bc3cc29215ac85fdc2c85b0c500 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 10 Dec 2025 22:12:05 +0000
Subject: [PATCH 12/17] Add Oxford commas to framework lists
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 2 +-
docs/core/deploying/trimming/prepare-libraries-for-trimming.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index d92692ac11c7e..75bf1da524ebf 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -109,7 +109,7 @@ These analyzers help to ensure that a library is compatible with Native AOT.
### Multi-targeting for AOT compatibility
-When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net8.0` to ensure that apps targeting `net8.0` or above get a version of your library that supports the AOT analyzers. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
+When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0`, or `net472`), you should also multi-target to `net8.0` to ensure that apps targeting `net8.0` or above get a version of your library that supports the AOT analyzers. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
```xml
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 3a0ff1082eb07..8c69876d55880 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -92,7 +92,7 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
## Multi-targeting for trimming
-When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0` or `net472`), you should also multi-target to `net6.0` to ensure that apps targeting `net6.0` or above get a version of your library that supports the trim analyzer. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
+When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0`, or `net472`), you should also multi-target to `net6.0` to ensure that apps targeting `net6.0` or above get a version of your library that supports the trim analyzer. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
```xml
From 2e62823d7b36e3c4f3733be702958b786b42b6f1 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 10 Dec 2025 22:19:53 +0000
Subject: [PATCH 13/17] Break up long sentences for better readability
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 2 +-
docs/core/deploying/trimming/prepare-libraries-for-trimming.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index 75bf1da524ebf..2ff1b8d2c6bf7 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -109,7 +109,7 @@ These analyzers help to ensure that a library is compatible with Native AOT.
### Multi-targeting for AOT compatibility
-When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0`, or `net472`), you should also multi-target to `net8.0` to ensure that apps targeting `net8.0` or above get a version of your library that supports the AOT analyzers. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
+When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0`, or `net472`), multi-target to `net8.0`. This ensures that apps targeting `net8.0` or above get a version of your library that supports the AOT analyzers. Also, include the latest .NET version so your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
```xml
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 8c69876d55880..d3a450bb1b7d8 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -92,7 +92,7 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
## Multi-targeting for trimming
-When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0`, or `net472`), you should also multi-target to `net6.0` to ensure that apps targeting `net6.0` or above get a version of your library that supports the trim analyzer. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
+When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0`, or `net472`), multi-target to `net6.0`. This ensures that apps targeting `net6.0` or above get a version of your library that supports the trim analyzer. Also, include the latest .NET version so your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
```xml
From f90cb1912ca6bc268832e24e5ac5b919573ec24c Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 6 Jan 2026 18:09:33 +0000
Subject: [PATCH 14/17] Clarify multi-targeting benefits for analyzer support
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 2 +-
docs/core/deploying/trimming/prepare-libraries-for-trimming.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index c94b88c5cbcc3..c18d3af9cf5f4 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -109,7 +109,7 @@ These analyzers help to ensure that a library is compatible with Native AOT.
### Multi-targeting for AOT compatibility
-When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0`, or `net472`), multi-target to `net8.0`. This ensures that apps targeting `net8.0` or above get a version of your library that supports the AOT analyzers. Also, include the latest .NET version so your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
+When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0`, or `net472`), multi-target to `net8.0`. This ensures that apps targeting `net8.0` or above get a version of your library built for `net8.0` or above, which enables the AOT analyzers to run during the library build. Also, include the latest .NET version to get the latest analyzer improvements. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
```xml
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 4389d46be6080..babbfdf9ec6f9 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -112,7 +112,7 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
## Multi-targeting for trimming
-When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0`, or `net472`), multi-target to `net6.0`. This ensures that apps targeting `net6.0` or above get a version of your library that supports the trim analyzer. Also, include the latest .NET version so your library is analyzed with the latest analyzer. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
+When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0`, or `net472`), multi-target to `net6.0`. This ensures that apps targeting `net6.0` or above get a version of your library built for `net6.0` or above, which enables the trim analyzers to run during the library build. Also, include the latest .NET version to get the latest analyzer improvements. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
```xml
From d045390df64fb4de8e6e8b63c0d8fb0eab053c2b Mon Sep 17 00:00:00 2001
From: Sven Boemer
Date: Tue, 6 Jan 2026 10:39:05 -0800
Subject: [PATCH 15/17] Rewrite
- Emphasize targeting latest TFM first.
- Clarify multi-targeting requirement as separate.
- Update heading to match more general guidance
---
docs/core/deploying/native-aot/index.md | 8 ++++++--
.../deploying/trimming/prepare-libraries-for-trimming.md | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index c18d3af9cf5f4..8f4d959643a68 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -107,9 +107,13 @@ The preceding configuration assigns a default of `true` to the following propert
These analyzers help to ensure that a library is compatible with Native AOT.
-### Multi-targeting for AOT compatibility
+### Target framework requirements
-When preparing libraries for AOT compatibility, if your library targets any framework earlier than `net8.0` (such as `netstandard2.0`, or `net472`), multi-target to `net8.0`. This ensures that apps targeting `net8.0` or above get a version of your library built for `net8.0` or above, which enables the AOT analyzers to run during the library build. Also, include the latest .NET version to get the latest analyzer improvements. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and above:
+When preparing libraries for AOT compatibility, target the latest supported TFM to benefit from the latest analyzer improvements. At minimum, target `net8.0` or later, which is required for AOT analysis warnings.
+
+If your library also targets frameworks earlier than `net8.0` (such as `netstandard2.0` or `net472`), multi-target to include `net8.0`. This ensures that apps targeting `net8.0` or later get a version of your library that supports AOT analysis.
+
+Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and later:
```xml
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index babbfdf9ec6f9..14af7a23f2cc8 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -110,9 +110,13 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
* Even if there were no API changes.
* Introducing trim analysis warnings is a breaking change when the library is used with `PublishTrimmed`.
-## Multi-targeting for trimming
+## Target framework requirements
-When preparing libraries for trimming, if your library targets any framework earlier than `net6.0` (such as `netstandard2.0`, or `net472`), multi-target to `net6.0`. This ensures that apps targeting `net6.0` or above get a version of your library built for `net6.0` or above, which enables the trim analyzers to run during the library build. Also, include the latest .NET version to get the latest analyzer improvements. Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and above:
+When preparing libraries for trimming, target the latest supported TFM to benefit from the latest analyzer improvements. At minimum, target `net6.0` or later, which is required for trim analysis warnings.
+
+If your library also targets frameworks earlier than `net6.0` (such as `netstandard2.0` or `net472`), multi-target to include `net6.0`. This ensures that apps targeting `net6.0` or later get a version of your library that supports trim analysis.
+
+Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and later:
```xml
From 8b188ace8f93bf4a69db3a525f22d6b84f12a3c2 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 6 Jan 2026 18:49:41 +0000
Subject: [PATCH 16/17] Add Oxford commas and fix grammar per review feedback
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 4 ++--
.../core/deploying/trimming/prepare-libraries-for-trimming.md | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index 8f4d959643a68..b83d065a01fd8 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -109,9 +109,9 @@ These analyzers help to ensure that a library is compatible with Native AOT.
### Target framework requirements
-When preparing libraries for AOT compatibility, target the latest supported TFM to benefit from the latest analyzer improvements. At minimum, target `net8.0` or later, which is required for AOT analysis warnings.
+When preparing libraries for AOT compatibility, target the latest supported TFM to benefit from the latest analyzer improvements. At a minimum, target `net8.0` or later, which is required for AOT analysis warnings.
-If your library also targets frameworks earlier than `net8.0` (such as `netstandard2.0` or `net472`), multi-target to include `net8.0`. This ensures that apps targeting `net8.0` or later get a version of your library that supports AOT analysis.
+If your library also targets frameworks earlier than `net8.0` (such as `netstandard2.0`, or `net472`), multi-target to include `net8.0`. This ensures that apps targeting `net8.0` or later get a version of your library that supports AOT analysis.
Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsAotCompatible` for `net8.0` and later:
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 14af7a23f2cc8..3a7ff2f622503 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -112,9 +112,9 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
## Target framework requirements
-When preparing libraries for trimming, target the latest supported TFM to benefit from the latest analyzer improvements. At minimum, target `net6.0` or later, which is required for trim analysis warnings.
+When preparing libraries for trimming, target the latest supported TFM to benefit from the latest analyzer improvements. At a minimum, target `net6.0` or later, which is required for trim analysis warnings.
-If your library also targets frameworks earlier than `net6.0` (such as `netstandard2.0` or `net472`), multi-target to include `net6.0`. This ensures that apps targeting `net6.0` or later get a version of your library that supports trim analysis.
+If your library also targets frameworks earlier than `net6.0` (such as `netstandard2.0`, or `net472`), multi-target to include `net6.0`. This ensures that apps targeting `net6.0` or later get a version of your library that supports trim analysis.
Use the `IsTargetFrameworkCompatible` MSBuild function to conditionally enable `IsTrimmable` for `net6.0` and later:
From 46df30ef45531c242e56fb91fff9dcd059fd0cb2 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 6 Jan 2026 18:54:38 +0000
Subject: [PATCH 17/17] Break up long sentences for better readability
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
---
docs/core/deploying/native-aot/index.md | 2 +-
docs/core/deploying/trimming/prepare-libraries-for-trimming.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/core/deploying/native-aot/index.md b/docs/core/deploying/native-aot/index.md
index b83d065a01fd8..51e10306fbdcd 100644
--- a/docs/core/deploying/native-aot/index.md
+++ b/docs/core/deploying/native-aot/index.md
@@ -109,7 +109,7 @@ These analyzers help to ensure that a library is compatible with Native AOT.
### Target framework requirements
-When preparing libraries for AOT compatibility, target the latest supported TFM to benefit from the latest analyzer improvements. At a minimum, target `net8.0` or later, which is required for AOT analysis warnings.
+When preparing libraries for AOT compatibility, target the latest supported TFM. This helps you benefit from the latest analyzer improvements. At a minimum, target `net8.0` or later. This version is required for AOT analysis warnings.
If your library also targets frameworks earlier than `net8.0` (such as `netstandard2.0`, or `net472`), multi-target to include `net8.0`. This ensures that apps targeting `net8.0` or later get a version of your library that supports AOT analysis.
diff --git a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
index 3a7ff2f622503..c20ee4907b7c1 100644
--- a/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
+++ b/docs/core/deploying/trimming/prepare-libraries-for-trimming.md
@@ -112,7 +112,7 @@ Follow the preceding pattern for multiple libraries. To see trim analysis warnin
## Target framework requirements
-When preparing libraries for trimming, target the latest supported TFM to benefit from the latest analyzer improvements. At a minimum, target `net6.0` or later, which is required for trim analysis warnings.
+When preparing libraries for trimming, target the latest supported TFM. This helps you benefit from the latest analyzer improvements. At a minimum, target `net6.0` or later. This version is required for trim analysis warnings.
If your library also targets frameworks earlier than `net6.0` (such as `netstandard2.0`, or `net472`), multi-target to include `net6.0`. This ensures that apps targeting `net6.0` or later get a version of your library that supports trim analysis.