Setting EnableDefaultCompileItems to False doesn't remove the files from solution Explorer
See original GitHub issueFrom @jinujoseph on February 8, 2017 23:9
Create a ClassLibrary (.Net Core) Take a copy of Class1.cs and drop in the same folder you will see of them included Now edit the csproj and put the below information
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
</ItemGroup>
</Project>
Build again , it includes only Class1.cs but the solution explorer shows all files, expected ?
Build 26206.0.d15rel
Copied from original issue: dotnet/project-system#1504
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Setting EnableDefaultCompileItems to False doesn't ...
Create a ClassLibrary (.Net Core) Take a copy of Class1.cs and drop in the same folder you will see of them included
Read more >EnableDefaultCompileItems issue. Compile Include items ...
set EnableDefaultCompileItems to false will hidden any compile files, this is not recommended. Use <PropertyGroup><EnableDefaultItems>true</ ...
Read more >Duplicate 'Compile' Items Included Error in Visual Studio
You can either remove these items from your project file, or set the 'EnableDefaultCompileItems' property to 'false' if you want to ...
Read more >Fixing the Duplicate Content Error after Upgrading Visual ...
Right click on the project in solution explorer, select Edit ... project file, or set the 'EnableDefaultContentItems' property to 'false' if ...
Read more >MSBuild reference for .NET SDK projects
Disable the generation of the temporary code file that contains the assembly info attributes by setting GenerateAssemblyInfo to false in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Moving this to SDK since this is caused by the None globs - @dsplaisted are they really useful? I find the None globs more annoying than useful since it picks up all files in that folder
See https://github.com/dotnet/project-system/issues/3181#issuecomment-368396256
Yes, I think this is the right fix.