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

Hide items with 'Visible=false' metadata #1126

Closed
natemcmaster opened this issue Jan 11, 2017 · 4 comments
Closed

Hide items with 'Visible=false' metadata #1126

natemcmaster opened this issue Jan 11, 2017 · 4 comments

Comments

@natemcmaster
Copy link

In VS 2015, items marked with metadata 'Visible' set to false did not appear in the solution explorer.
cref https://msdn.microsoft.com/en-us/library/ms171468.aspx

In VS2017, these items appear.

Repo:

  1. Add a file 'somehiddenfile.txt' to a project folder.
  2. Add to csproj
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
     <None Include="somehiddenfile.txt" Visible="false" />
  </ItemGroup>
</Project>

image

Using 15.0.26109.1

@davkean
Copy link
Member

davkean commented Jan 11, 2017

Hmm, <Visible>false</Visible> is respected - I think what's probably happening here is that the implicit globs are re-adding the file with different metadata. @dsplaisted

@natemcmaster
Copy link
Author

Yeah, that's probably what is happening. It seems to go away when opting-out of default items.

<EnableDefaultNoneItems>false</EnableDefaultNoneItems>

@rainersigwald
Copy link
Member

You could keep the default items if you change to

     <None Update="somehiddenfile.txt" Visible="false" />

Where Update means "change metadata on existing item" rather than "add a new item to the list".

@srivatsn
Copy link
Contributor

This should now be fixed with dotnet/sdk#624. Please reopen if you are still seeing this.

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

No branches or pull requests

4 participants