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.

Add item templates for Directory.Build.props and Directory.Build.targets

See original GitHub issue

I’m finding myself creating Directory.Build.props and Directory.Build.targets files more and more often these days and having item templates for those in the CLI would be helpful.

Directory.Build.props

Property Value
Name Directory.Build.props file
Short Name (idea 1) props
Short Name (idea 2) directorybuildprops
Language (blank)
Tags Build

Content:

<Project>
  <!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
  <PropertyGroup>
    
  </PropertyGroup>

</Project>

Directory.Build.targets

Property Value
Name Directory.Build.targets file
Short Name (idea 1) targets
Short Name (idea 2) directorybuildtargets
Language (blank)
Tags Build

Content:

<Project>

  <!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
  <Target Name="CustomAfterBuildTarget" AfterTargets="Build">
    
  </Target>

</Project>

@timheuer @dsplaisted @baronfel

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
baronfelcommented, Jul 22, 2022

What do you think of buildprops and buildtargets? In contrast to something like slnprops/slntargets (for Directory.Solution.props/targets files).

1reaction
baronfelcommented, Dec 20, 2022

The buildprops and buildtargets templates should ship with 7.0.200 - thank you for the suggestion!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize your build - MSBuild
Build.props or add properties and targets to Directory.Build.targets to customize the build for all projects under a folder.
Read more >
Customize your build by folder or solution - MSBuild
props is a user-defined file that provides customizations to projects under a directory. Similarly, Microsoft.Common.targets looks for Directory ...
Read more >
Common MSBuild properties and items with Directory.Build ...
This makes it very easy to share common properties and items across projects. ... Build.props file in the parent directory of your projects:....
Read more >
What is this Directory.Build.props file all about?
Adding a single file called Directory.Build.props in the root folder that contains your source code and solution file, is executed when MSBuild ...
Read more >
MSBuild: directory.build.props and directory.build.targets ...
Good to know. I am curious though, the project templates for a new Setup Project (*.wixproj) is shipped as part of the Visual...
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