From baf58e6ef126ae3107dbd236554607d03661677c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Mar 2026 14:35:57 +0000 Subject: [PATCH 1/4] Initial plan From 4ffd71bd87d7baec26316ca3a6b178162a062c00 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Mar 2026 14:40:03 +0000 Subject: [PATCH 2/4] Clarify Default includes and excludes section in project SDK overview Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/core/project-sdk/overview.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/core/project-sdk/overview.md b/docs/core/project-sdk/overview.md index 657dc2dedadff..37fdfb324c006 100644 --- a/docs/core/project-sdk/overview.md +++ b/docs/core/project-sdk/overview.md @@ -2,7 +2,8 @@ title: .NET project SDK overview titleSuffix: "" description: Learn about the .NET project SDKs. -ms.date: 10/15/2024 +ms.date: 03/20/2026 +ai-usage: ai-assisted ms.topic: concept-article no-loc: ["EmbeddedResource", "Compile", "None", "Blazor"] --- @@ -97,9 +98,21 @@ If the project has multiple target frameworks, focus the results of the command ## Default includes and excludes -The default includes and excludes for [`Compile` items](/visualstudio/msbuild/common-msbuild-project-items#compile), [embedded resources](/visualstudio/msbuild/common-msbuild-project-items#embeddedresource), and [`None` items](/visualstudio/msbuild/common-msbuild-project-items#none) are defined in the SDK. Unlike non-SDK .NET Framework projects, you don't need to specify these items in your project file, because the defaults cover most common use cases. This behavior makes the project file smaller and easier to understand and edit by hand, if needed. +The SDK automatically manages three types of items for your project: -The following table shows which elements and which [globs](https://en.wikipedia.org/wiki/Glob_(programming)) are included and excluded in the .NET SDK: +- [`Compile` items](/visualstudio/msbuild/common-msbuild-project-items#compile): source code files (*.cs*, *.vb*, and other language-specific extensions) that get compiled into your assembly. +- [`EmbeddedResource` items](/visualstudio/msbuild/common-msbuild-project-items#embeddedresource): *.resx* files that get embedded into your assembly. +- [`None` items](/visualstudio/msbuild/common-msbuild-project-items#none): all other files tracked in the project, such as configuration and content files, that aren't compiled or embedded. + +Unlike non-SDK .NET Framework projects, you don't need to specify these items in your project file, because the defaults cover most common use cases. This behavior makes the project file smaller and easier to understand and edit by hand, if needed. + +The SDK uses [glob](https://en.wikipedia.org/wiki/Glob_(programming)) patterns to determine which files belong to each item type: + +- **Include glob**: Specifies which files to add to the item type. +- **Exclude glob**: Specifies which files to skip when applying the include glob. +- **Remove glob**: Specifies which files to remove from items that were already added by the include glob. + +The following table shows the default glob patterns for each item type in the .NET SDK: | Element | Include glob | Exclude glob | Remove glob | |---------|--------------|--------------|-------------| @@ -107,12 +120,15 @@ The following table shows which elements and which [globs](https://en.wikipedia. | EmbeddedResource | \*\*/\*.resx | \*\*/\*.user; \*\*/\*.\*proj; \*\*/\*.sln(x); \*\*/\*.vssscc | N/A | | None | \*\*/\* | \*\*/\*.user; \*\*/\*.\*proj; \*\*/\*.sln(x); \*\*/\*.vssscc | \*\*/\*.cs; \*\*/\*.resx | +Because `None` uses `**/*` as its include glob, it would otherwise include *.cs* and *.resx* files that are already captured by `Compile` and `EmbeddedResource`. The remove glob (`**/*.cs; **/*.resx`) prevents those files from appearing in both item types at the same time. + > [!NOTE] > The `./bin` and `./obj` folders, which are represented by the `$(BaseOutputPath)` and `$(BaseIntermediateOutputPath)` MSBuild properties, are excluded from the globs by default. Excludes are represented by the [DefaultItemExcludes property](msbuild-props.md#defaultitemexcludes). The .NET Desktop SDK has additional includes and excludes for WPF. For more information, see [WPF default includes and excludes](msbuild-props-desktop.md#wpf-default-includes-and-excludes). -If you explicitly define any of these items in your project file, you're likely to get a [NETSDK1022](../tools/sdk-errors/netsdk1022.md) build error. For information about how to resolve the error, see [NETSDK1022: Duplicate items were included](../tools/sdk-errors/netsdk1022.md). +> [!WARNING] +> Don't explicitly define `Compile`, `EmbeddedResource`, or `None` items in your project file. The SDK already includes these items via the default globs, so defining them again causes the build to include the same files twice, resulting in a [NETSDK1022](../tools/sdk-errors/netsdk1022.md) build error. For information about how to resolve the error, see [NETSDK1022: Duplicate items were included](../tools/sdk-errors/netsdk1022.md). ## Implicit using directives From a87821e9646938cb281e5f50a3e9f825eb666161 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 20 Mar 2026 19:46:30 -0400 Subject: [PATCH 3/4] Update docs/core/project-sdk/overview.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/core/project-sdk/overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/project-sdk/overview.md b/docs/core/project-sdk/overview.md index 37fdfb324c006..beed587c21d8f 100644 --- a/docs/core/project-sdk/overview.md +++ b/docs/core/project-sdk/overview.md @@ -100,8 +100,8 @@ If the project has multiple target frameworks, focus the results of the command The SDK automatically manages three types of items for your project: -- [`Compile` items](/visualstudio/msbuild/common-msbuild-project-items#compile): source code files (*.cs*, *.vb*, and other language-specific extensions) that get compiled into your assembly. -- [`EmbeddedResource` items](/visualstudio/msbuild/common-msbuild-project-items#embeddedresource): *.resx* files that get embedded into your assembly. +- [`Compile` items](/visualstudio/msbuild/common-msbuild-project-items#compile): source code files (`*.cs`, `*.vb`, and other language-specific extensions) that get compiled into your assembly. +- [`EmbeddedResource` items](/visualstudio/msbuild/common-msbuild-project-items#embeddedresource): `*.resx` files that get embedded into your assembly. - [`None` items](/visualstudio/msbuild/common-msbuild-project-items#none): all other files tracked in the project, such as configuration and content files, that aren't compiled or embedded. Unlike non-SDK .NET Framework projects, you don't need to specify these items in your project file, because the defaults cover most common use cases. This behavior makes the project file smaller and easier to understand and edit by hand, if needed. From b0511e0fd81b890686883fff926787122e7d5f75 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 20 Mar 2026 19:46:43 -0400 Subject: [PATCH 4/4] Update docs/core/project-sdk/overview.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/core/project-sdk/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/project-sdk/overview.md b/docs/core/project-sdk/overview.md index beed587c21d8f..ce34eb1c9a955 100644 --- a/docs/core/project-sdk/overview.md +++ b/docs/core/project-sdk/overview.md @@ -128,7 +128,7 @@ Because `None` uses `**/*` as its include glob, it would otherwise include *.cs* The .NET Desktop SDK has additional includes and excludes for WPF. For more information, see [WPF default includes and excludes](msbuild-props-desktop.md#wpf-default-includes-and-excludes). > [!WARNING] -> Don't explicitly define `Compile`, `EmbeddedResource`, or `None` items in your project file. The SDK already includes these items via the default globs, so defining them again causes the build to include the same files twice, resulting in a [NETSDK1022](../tools/sdk-errors/netsdk1022.md) build error. For information about how to resolve the error, see [NETSDK1022: Duplicate items were included](../tools/sdk-errors/netsdk1022.md). +> Avoid defining `Compile`, `EmbeddedResource`, or `None` items that duplicate the SDK's default `Include` globs. Duplicating included files causes the build to include the same files twice, which results in a [NETSDK1022](../tools/sdk-errors/netsdk1022.md) build error. Customizations that use `Remove` or `Update`, or that add items after you set `EnableDefaultItems`, `EnableDefaultCompileItems`, or `EnableDefaultEmbeddedResourceItems` to `false`, are supported. For information about how to resolve the error, see [NETSDK1022: Duplicate items were included](../tools/sdk-errors/netsdk1022.md). ## Implicit using directives