Duplicate 'Content' items were included.

Nicolas Hutchison asked on April 30, 2024 20:25

When I build the application locally it builds and runs fine but when it goes to build in our TFS pipeline it throws the following 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\e2tsbD3.nuget\packages\skiasharp.nativeassets.win32\2.88.6\buildTransitive\net462....\runtimes\win-x86\native\libSkiaSharp.dll'; 'C:\Users\e2tsbD3.nuget\packages\skiasharp.nativeassets.win32\2.88.6\buildTransitive\net462....\runtimes\win-x64\native\libSkiaSharp.dll'; 'C:\Users\e2tsbD3.nuget\packages\skiasharp.nativeassets.win32\2.88.6\buildTransitive\net462....\runtimes\win-arm64\native\libSkiaSharp.dll'; 'C:\Users\e2tsbD3.nuget\packages\skiasharp.nativeassets.macos\2.88.6\buildTransitive\net462....\runtimes\osx\native\libSkiaSharp.dylib'

Recent Answers


Brenden Kehren answered on May 2, 2024 15:36

Can you specify more how this issue is related to Kentico Xperience or Xperience by Kentico?

What version are you running?

Do you have multiple projects referencing that package?

0 votesVote for this answer Mark as a Correct answer

Nicolas Hutchison answered on May 2, 2024 20:24

The duplicate package is from Kentico as a dependency. But A guy on my team figured it out. In case anyone else has the same issue: "one of the blog mentioned to change the task to dotnet restore since the nuget restore task packages were not restoring as expected."

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on May 2, 2024 20:40

So sounds like it's a dev environment issue and not so much a Kentico issue?

If the packages are not restoring properly, you can also force them to reinstall. Using a developer command prompt run:

Update-Package --reinstall

This will uninstall all packages for the solution and reinstall them. Documentation

0 votesVote for this answer Mark as a Correct answer

Elmar Höfinghoff answered on May 3, 2024 09:39

Have you checked your project file and removed all douplicate file references?

0 votesVote for this answer Mark as a Correct answer

Nicolas Hutchison answered on May 3, 2024 20:47

yes, it wasn't an issue with the file system but with our release pipeline.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.