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

Created on 27 Apr 2017  路  8Comments  路  Source: dotnet/sdk

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

Bug Urgency-Soon

Most helpful comment

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

All 8 comments

_From @davkean on February 9, 2017 0:19_

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

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.

_From @davkean on February 22, 2017 23:6_

Ah, that's bad.

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 , @livarcocc Any timeline for the fix or known workarounds?

@dsplaisted for a work around.

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.

@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.

Was this page helpful?
0 / 5 - 0 ratings