sdk: error MSB3105: The item "XXX.cs" was specified more than once in the "Sources" parameter.
While trying to build this PR https://github.com/Microsoft/Docker.DotNet/pull/144 for some reason it is thinking I have a duplicated file in the CI build at AppVeyor.
C:\Program Files\dotnet\sdk\1.0.0-preview5-004460\Roslyn\Microsoft.CSharp.Core.targets(71,5): error MSB3105: The item "AnonymousCredentials.cs" was specified more than once in the "Sources" parameter. Duplicate items are not supported by the "Sources" parameter. [C:\projects\docker-dotnet\Docker.DotNet\Docker.DotNet.csproj]
1.0.0-preview5-004232 build it just fine. However, the latest version 1.0.0-preview5-004460 throw this error for the same project…
Any ideas?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (12 by maintainers)
In my case this was a problem as the .csproj.user file had a reference in it as well as the .csproj - so have a look in both files - if it exists in both this can cause the problem
The latest SDK adds all .cs files by default now without any “Compile” lines.
To fix the error either:
<EnableDefaultItems>false</EnableDefaultItems>property in your .csproj.This experience will get better once #600 is fixed.