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 #1157

Closed
srivatsn opened this issue Apr 27, 2017 · 9 comments
Assignees
Milestone

Comments

@srivatsn
Copy link
Contributor

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

@srivatsn
Copy link
Contributor Author

From @davkean on February 9, 2017 0:19

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

@srivatsn
Copy link
Contributor Author

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.

@srivatsn
Copy link
Contributor Author

From @davkean on February 22, 2017 23:6

Ah, that's bad.

@srivatsn
Copy link
Contributor Author

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

@amanbha
Copy link

amanbha commented Feb 2, 2018

@srivatsn , @livarcocc Any timeline for the fix or known workarounds?

@livarcocc
Copy link
Contributor

@dsplaisted for a work around.

@nguerrera
Copy link
Contributor

See dotnet/project-system#3181 (comment)

maybe None shouldn't include source files?

Yes, I think this is the right fix.

@nguerrera
Copy link
Contributor

@livarcocc @dsplaisted, we should probably re-triage this. It gets reported a lot and I think @davkean has a good, simple proposal to address it.

@baskren
Copy link

baskren commented Mar 4, 2021

Looks like this issue is back w/ Version 16.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants