1

I am running into this error:

Error NETSDK1022: Duplicate 'Content' items were included. The .NET SDK includes 'Content' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultContentItems' property to 'false' if you want to explicitly include them in your project file. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: 'C:\Users......\microsoft.cloud.instrumentationframework.vc14\3.1.6.86\build\native\lib\concrt140.dll';

Adding the EnableDefaultContentItems tag makes the build successful, but many of the important project files go missing in the final artifact.

(Edit: The important files include the xARM, x64, x86 folders which have the sdk binaries.)

I have referred multiple articles on internet related to this, but all of those were facing issues related to wwwroot folder.

For example: Duplicate 'Content' items were included. The .NET SDK includes 'Content' items from your project directory by default

Issue I am facing is with the microsoft sdk library files. Any help would be appreciated.

varun
  • 23
  • 5

1 Answers1

0

Please find if the below steps help to resolve the issue:

Adding a directory.build.props in the root folder of your project to set the <EnableDefaultCompileItems>false<EnableDefaultCompileItems> is probably the simplest method to fix this for all projects at once.

<Project>
    <PropertyGroup>
         <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
    </PropertyGroup>
</Project>

Please refer this troubleshooting doc for more information:

  • 2
    Hi, Thanks for responding, but the solution does not seem to work as the "Content" files are duplicate. Adding the compile tag did not solve the problem. Adding ContentTag in the directory.build.props also gave same error. – varun Jun 21 '22 at 05:50