What Broke in the Build
The project explicitly includes files that SDK-style projects already include by default, creating duplicate items.
Fix the underlying build failure
Remove redundant Compile or Content entries from the project file, which is usually the best fix, or disable the relevant defaults with EnableDefault*Items=false if you want full manual control, and rebuild with dotnet build.
Validation
Re-run the failing command and confirm the original code/message is gone, and confirm expected artifacts or outputs exist (packages restored, build/publish succeeds).
Typical Output
error NETSDK1022: Duplicate 'Content' items were included. The duplicate items were: 'appsettings.json' Why the Build Fails
Usually this comes down to leftover explicit globbing remains after migrating to an SDK-style project, custom includes overlap with the SDK defaults, or imported props or targets add the same items twice.
Prove the Build Path Is Clean
dotnet build succeeds without NETSDK1022.
The duplicated file appears only once in the evaluated build items or binlog.
Mechanism
SDK-style projects add Compile and Content items automatically from the project directory. Explicit ItemGroup entries that overlap those defaults trigger NETSDK1022.
Keep Build Prerequisites Consistent
To prevent this, keep SDK-style project files minimal and rely on defaults where possible, and validate migrations in CI with a clean build rather than incremental state.
Docs and source code
NETSDK1022 message template
User-facing message template explaining default includes. - GitHub
<data name="DuplicateItemsError" xml:space="preserve">
<value>NETSDK1022: Duplicate '{0}' items were included. The .NET SDK includes '{0}' items from your project directory by default. You can either remove these items from your project file, or set the '{1}' property to '{2}' if you want to explicitly include them in your project file. For more information, see {4}. The duplicate items were: {3}</value>
<comment>{StrBegins="NETSDK1022: "}</comment>
</data>