question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Related files support

See original GitHub issue

C# and VB have a registration API for automatically registering dependency relationship between files so that they are automatically parented underneath and hidden in some cases.

For example, in VB, Foo.Designer.cs and Foo.resx is automatically grouped under Foo.cs, and both are hidden by default.

We should implement similar support - but I’d like to see an MSBuild equivalent of this - not via the registry as it is today:

image

See: CVbPackage::InitializeRelatedFiles and CCSharpPackage::InitializeRelatedFiles internally.

We should make sure that we have sensible defaults that do not require DependantUpon metadata item to be written to the project file.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:37 (26 by maintainers)

github_iconTop GitHub Comments

13reactions
NickCravercommented, Aug 20, 2018

@MovGP0 FWIW, you can shorten that greatly in MSBuild 15+, like this:

  <ItemGroup>
    <Content Update="appsettings.Development.json" DependentUpon="appsettings.json" />
    <Content Update="appsettings.Staging.json" DependentUpon="appsettings.json" />
  </ItemGroup>

…and if using an SDK project, further with wildcards:

  <ItemGroup>
    <Content Update="appsettings.*.json" DependentUpon="appsettings.json" />
  </ItemGroup>

Of course the configurable version is much better, but it’s at least a lot better manually in .csproj due to other changes there already.

7reactions
MovGP0commented, Aug 20, 2018

Just for your info: you can configure file nesting manually using the <DependentUpon> attribute.

Ie. for the appsettings.json, this would look like the following in your .csproj file:

  <ItemGroup>
    <None Remove="appsettings*.json" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="appsettings.json" />
    <Content Include="appsettings.Development.json">
      <DependentUpon>appsettings.json</DependentUpon>
    </Content>
    <Content Include="appsettings.Staging.json" >
      <DependentUpon>appsettings.json</DependentUpon>
    </Content>
  </ItemGroup>

I agree that this should be detected automatically by default.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Relating Files Deep Dive | Canto : Help Center - Support
Go to the preview/information page of an asset. · Locate the Related Files section. · Click on Create New. · Select the asset(s)...
Read more >
Supporting Files Definition
Supporting information means the experience and judgment of the filer and the experience or data of other insurers or organizations relied on by...
Read more >
Incorrect Related Files Showing.
Dreamweaver shows the WRONG RELATED files in the related files panel at the top, just under the file name tab. It's done this...
Read more >
Supported File Formats
You can send many types of files through DocuSign. DocuSign eSignature supports the following file types: DOCUMENT .doc, .docm, .docx, .dot, ...
Read more >
What are the supported file types? - Widen Connect
A number of file types are supported in the Acquia DAM (Widen). ... Supported files can be searched for by file type and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found