question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting EnableDefaultCompileItems to False doesn't remove the files from solution Explorer

See original GitHub issue

From @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 ?

image

Build 26206.0.d15rel

Copied from original issue: dotnet/project-system#1504

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
srivatsncommented, Apr 27, 2017

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

2reactions
nguerreracommented, Feb 26, 2018

See https://github.com/dotnet/project-system/issues/3181#issuecomment-368396256

maybe None shouldn’t include source files?

Yes, I think this is the right fix.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found