Hide files in .csproj without excluding them from build

五迷三道 提交于 2020-01-04 04:05:09

问题


Is it possible to hide files/folders in .net core csproj without excluding them from build? I have a folder containing generated files which I would rather see they are not visible inside Solution Explorer in Visual Studio.


回答1:


You can set the Visible="false" attribute on the items.

For an SDK-based project (.net core / asp.net core templates), you could add e.g.:

<ItemGroup>
  <Content Update="**/*.css" Visible="false" />
</ItemGroup>

Depending on your project type (=> defaults), you might have to replace Content with None for the particular type, or even Compile for generated code files.



来源:https://stackoverflow.com/questions/45613251/hide-files-in-csproj-without-excluding-them-from-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!