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

[Feature Request] Add MSBuild option to hide templates from VS project tree #9549

Closed
jwfx opened this issue Dec 19, 2023 · 3 comments · Fixed by #9554
Closed

[Feature Request] Add MSBuild option to hide templates from VS project tree #9549

jwfx opened this issue Dec 19, 2023 · 3 comments · Fixed by #9554
Labels
fundamental Engineering system and core components

Comments

@jwfx
Copy link
Contributor

jwfx commented Dec 19, 2023

Is your feature request related to a problem? Please describe.

When consuming the docfx.app NuGet package, a templates folder is added to the VS project tree.

image

This is mainly because the corresponding issue NuGet/Home#4856 has not been solved for multiple years.

Describe the solution you'd like
The linked issue proposes a workaround.

I have modified this workaround and prepared a possible solution, that allows users to opt for hiding the folder by simple specifying <DocfxExcludeTemplates>true</DocfxExcludeTemplates> in their project.

Please let me know if I should turn this into a pull request.

Describe alternatives you've considered
The only other option I see is to apply the workaround manually to every project that is consuming docfx.app, but I believe this really should be solved on package level for everyone, until the underlying issue is fixed.

@filzrev
Copy link
Contributor

filzrev commented Dec 19, 2023

I'm also facing the same issue (it's annoying that templates files hits when solution-scoped search).
And use same workaround above by placing Directory.Build.targets file to solution root folder.

<Project>
  <ItemGroup>
    <Content Update="@(Content)">
      <Visible Condition="'%(NuGetPackageId)' == 'Docfx.App' AND '%(NuGetItemType)' == 'Content'">false</Visible>
    </Content>
  </ItemGroup>
</Project>

Note

Directory.Build.props file can't be used here. (Because props file is applied before importing Nuget files)

@yufeih
Copy link
Contributor

yufeih commented Dec 20, 2023

@jwfx The proposed workaround looks great! Would you like to convert it into a pull request? The only change I would make is to remove the DocfxExcludeTemplates switch, assuming most people don't want templates to appear in their solution.

@yufeih yufeih added the fundamental Engineering system and core components label Dec 20, 2023
@jwfx
Copy link
Contributor Author

jwfx commented Dec 20, 2023

@yufeih
Thanks for the feedback. Pull request as above. Not sure I chose the right changelog category, so feel free to edit the title to your liking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fundamental Engineering system and core components
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants