I am aware of .NET Core's change to the .csproj file, and how the GLOB automatically detects *.cs files, as as documented here. However, the issue is I am still running into a certain error upon compile.
As documented in the above link, I keep getting the error:
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.
My project is picking up all *.cs files perfectly fine within the project directory. However, whenever I ** ADD A NEW** class (right click >> add new item), the following is also added into the .csproj:
<ItemGroup>
<Compile Include="Base\Class1.cs" />
</ItemGroup>
I know that simply removing this will prevent the error from occurring, since this explicit compile conflicts with the GLOB's implicit include. How can I stop this from happening?
EDIT
Here is my .csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>8</LangVersion>
<NeutralLanguage>en</NeutralLanguage>
<Authors>Phillip Smith</Authors>
<Company>Phillip Smith</Company>
<Description>.Net Standard library to read and write .m64 files for Mupen64</Description>
<PackageIcon>nugetIcon.png</PackageIcon>
<PackageTags>mupen, n64, m64</PackageTags>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<PackageProjectUrl>https://github.com/TimeTravelPenguin/MupenSharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/TimeTravelPenguin/MupenSharp</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.3.5</Version>
<Copyright>Phillip Smith</Copyright>
<PackageLicenseExpression></PackageLicenseExpression>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>D:\C#_Offline\MupenMovieEditor\MupenSharp\MupenSharp.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2020.3.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.ComponentModel.DataAnnotations">
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.ComponentModel.DataAnnotations.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="..\..\Images\nugetIcon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\ExceptionsResource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ExceptionsResource.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\ExceptionsResource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ExceptionsResource.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
EDIT 2
Video demonstration:
