A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1022 below:

NETSDK1022: Duplicate items were included - .NET CLI

This article applies to: ✔️ .NET Core 2.1.100 SDK and later versions

Starting in Visual Studio 2017 / MSBuild version 15.3, the .NET SDK automatically includes items from the project directory by default. These items include Compile and Content targets. This behavior simplifies project files.

However, if you explicitly define any of these items in your project file, you're likely to get a build error similar to the following:

Duplicate 'Compile' items were included. The .NET SDK includes 'Compile' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultCompileItems' property to 'false' if you want to explicitly include them in your project file.

Duplicate 'EmbeddedResource' items were included. The .NET SDK includes 'EmbeddedResource' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultEmbeddedResourceItems' property to 'false' if you want to explicitly include them in your project file.

To resolve the errors, do one of the following:

WPF projects

You might hit this error in a WPF project due to duplicate ApplicationDefinition or Page items. To resolve the error, can you disable default items using an MSBuild property. For example, to disable default Page items in a WPF project, set EnableDefaultPageItems to false:

<PropertyGroup>
  <EnableDefaultPageItems>false</EnableDefaultPageItems>
</PropertyGroup>

For more information, see Errors related to duplicate items (WPF).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4