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

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

Closed
jinujoseph opened this issue Feb 8, 2017 · 9 comments
Assignees
Labels
Bug This is a functional issue in already written code.
Milestone

Comments

@jinujoseph
Copy link
Contributor

jinujoseph commented Feb 8, 2017

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

@davkean
Copy link
Member

davkean commented Feb 9, 2017

This is because <None> picks them up. @dsplaisted

@srivatsn srivatsn added this to the 1.1 milestone Feb 9, 2017
@srivatsn srivatsn added the Bug This is a functional issue in already written code. label Feb 9, 2017
@srivatsn
Copy link
Contributor

srivatsn commented Feb 22, 2017

Another side effect of this reported through VSFeedback is that when the user goes to add a cs file to the project in this state, the None glob picks it up and so it's not passed to the compiler as a source file.

@davkean
Copy link
Member

davkean commented Feb 22, 2017

Ah, that's bad.

@srivatsn
Copy link
Contributor

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

@srivatsn
Copy link
Contributor

This issue was moved to dotnet/sdk#1157

@ghost
Copy link

ghost commented Aug 14, 2019

use false instead of False

@baskren
Copy link

baskren commented Mar 4, 2021

Looks like this issue is back with Version 16.9.0

@dsplaisted
Copy link
Member

@baskren This is an old issue, could you file a new one with details / repro steps if you're still hitting something like this?

Thanks,
Daniel

@baskren
Copy link

baskren commented Mar 5, 2021

@dsplaisted 👍

Done: #7002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a functional issue in already written code.
Projects
None yet
Development

No branches or pull requests

5 participants