Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The item "Class1.cs" was specified more than once in the "Sources" parameter. Duplicate items are not supported by the "Sources" parameter. #7570

Closed
enricforn opened this issue Jan 20, 2017 · 5 comments

Comments

@enricforn
Copy link

Steps to reproduce

Clone repo https://github.com/enricforn/dotnetcore-webapi-sample-app.git

Use dotnetcore sdk version 1.0.0-rc4-004530

run dotnet restore

run dotnet build -v:n

Expected behavior

Compilation successful

Actual behavior

Runs successfully on Visual Studio 2017RC environment Build 26020.00

Fails compiling in command line.
C:\Program Files\dotnet\sdk\1.0.0-rc4-004530\Roslyn\Microsoft.CSharp.Core.targets(71,5): error MSB3105: The item "Class1.cs" was specified more than once in the "Sources" parameter. Duplicate items are not supported by the "Sources" parameter. [D:\workspaces\enricforn\dotnetcore-webapi-sample-app\ClassLibraryTest\ClassLibraryTest.csproj]

Environment data

dotnet --info output:

PS D:\workspaces\enricforn\dotnetcore-webapi-sample-app> dotnet --version
1.0.0-rc4-004530

##Possible workaround

I tried to solve the issue using workaround #668 but it doesn`t work.

@livarcocc
Copy link
Contributor

@enricforn I just tried this and I managed to build the solution.

This is what my ClassLibraryTest.csproj looks like:

<Project Sdk="Microsoft.NET.Sdk" >
  <PropertyGroup>
    <TargetFramework>netstandard1.4</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <EmbeddedResource Include="**\*.resx" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="NETStandard.Library" Version="1.6" />
  </ItemGroup>

</Project>

If this does not solve your problem, please re-open this issue.

@enricforn
Copy link
Author

enricforn commented Jan 22, 2017

@livarcocc if I remove these lines, Visual Studio 2017 do not recognize the class as added to the project.

I can't reopen the issue.

@livarcocc
Copy link
Contributor

You may have an older version of VS, which does not understand globing yet.

@enricforn
Copy link
Author

@livarcocc we're reproducing the error on build 26020.00, is there a new downloadable version ?

@livarcocc
Copy link
Contributor

@balachir can you help with that?

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants