title: Duplicate 'Compile' items were included
body: <p>I have just added a SOAP webservice to a new Asp .net core project. When i try to build the project it results int he following error.</p>
  
  <blockquote>
    <p>Microsoft.NET.Sdk.DefaultItems.targets(295, 5): [NETSDK1022] Duplicate 'Compile' items were included. The .NET SDK includes 'Compile' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultCompileItems' property to 'false' if you want to explicitly include them in your project file. For more information, see <a href="https://aka.ms/sdkimplicititems" rel="noreferrer">https://aka.ms/sdkimplicititems</a>. The duplicate items were: 'Service References/WebService/WebService.cs'</p>
  </blockquote>
  
  <p>After a bit of Googleing i have seen similar errors when people rename files.  But I haven't renamed anything this is a new project I have only added the web-service.</p>
  
  <p>I checked the .csproj file and i get this</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk.Web"&gt;
  
      &lt;PropertyGroup&gt;
          &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
          &lt;EnableDefaultContentItems&gt;false&lt;/EnableDefaultContentItems&gt;
      &lt;/PropertyGroup&gt;
  
      &lt;ItemGroup&gt;
        &lt;Reference Include="System.ServiceModel" /&gt;
      &lt;/ItemGroup&gt;
  
      &lt;ItemGroup&gt;
        &lt;WCFMetadata Include="Service References" /&gt;
      &lt;/ItemGroup&gt;
  
      &lt;ItemGroup&gt;
        &lt;WCFMetadataStorage Include="Service References\testing" /&gt;
        &lt;WCFMetadataStorage Include="Service References\WebService" /&gt;
      &lt;/ItemGroup&gt;
  
      &lt;ItemGroup&gt;
        &lt;None Include="Service References\WebService\WebService.svcmap"&gt;
          &lt;Generator&gt;WCF Proxy Generator&lt;/Generator&gt;
          &lt;LastGenOutput&gt;WebService.cs&lt;/LastGenOutput&gt;
        &lt;/None&gt;
        &lt;None Include="Service References\WebService\WebService.webref" /&gt;
        &lt;None Include="Service References\WebService\WebService.wsdl" /&gt;
      &lt;/ItemGroup&gt;
  
      &lt;ItemGroup&gt;
        &lt;Compile Include="Service References\WebService\WebService.cs"&gt;
          &lt;AutoGen&gt;True&lt;/AutoGen&gt;
          &lt;DesignTime&gt;True&lt;/DesignTime&gt;
          &lt;DependentUpon&gt;WebService.svcmap&lt;/DependentUpon&gt;
        &lt;/Compile&gt;
      &lt;/ItemGroup&gt;
  
  
  &lt;/Project&gt;
  </code></pre>
  
  <p>I am only seeing one Compile so at a lost too understand whats being duplicated.  I did try <code>EnableDefaultCompileItems</code> which has not resolved the issue.  But considering what it does im not that happy with having it there, Even if it did work.</p>
  
  <p>Any help in understanding the cause of this problem and fixing it would be appreciated.</p>
  
  <p>Note: I am using Rider not Visual studio</p>
  
  <h1>Update</h1>
  
  <p>I did find this one link which seams to imply its an issue in rider and how it adds the web services <a href="https://youtrack.jetbrains.com/issue/RIDER-18721" rel="noreferrer">Rider Creates Incorrect Webservice References for ASP .NET Core projects.</a></p>
  
  <p>Im not sure that this is the same issue though.  As i have created a .net core web api not asp .net core project.  </p>
  
  <h1>Update 2</h1>
  
  <blockquote>
    <p>On the  element in your project file, does it fix the issue if you change the "Include" to say "Update"?  </p>
  </blockquote>
  
  <p>The above was a suggestion from twitter. It appears to remove the original error but then results in a large number of name space errors.</p>
  
  <blockquote>
    <p>WebService.cs(727, 82): [CS0234] The type or namespace name 'IClientChannel' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)</p>
  </blockquote>