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.

Allow suppressing of $(Configuration) being added to $(OutputPath)

See original GitHub issue

In the .props files, we have

https://github.com/dotnet/sdk/blob/2eb6c546931b5bcb92cd3128b93932a980553ea1/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultOutputPaths.targets#L33-L34

This unconditionally adds $(Configuration) to the end of $(OutputPath). This prevents a Directory.Build.props file from customizing the output path to arrange all output paths first by $(Configuration) and then by $(MSBuildProjectName) under some top-level bin directory.

There is already a $(AppendTargetFrameworkToOutputPath) property that can suppress adding the target framework. Can we please add $(AppendConfigurationToOutputPath) so that we can set it to false in Directory.Build.props?

Note: it’s too late to reset the $(OutputPath) in our Directory.Build.targets file to what we want, because by then, many other properties based on $(OutputPath) have already been set, and there’s no way to exhaustively reset them all, nor would we want to.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marcpopMSFTcommented, Jul 15, 2020

Seems like a reasonable request but below our current priority list. We’d review a PR if there was interest in contributing this.

0reactions
AArnottcommented, Jul 8, 2020

My “workaround” at present has been to give up on my preferred top-level bin directory structure. If there’s some property I can set in my Directory.Build.props file that will make this work, I’m interested. I don’t want to set it once, then set it again later to ‘override’ what the SDK does, because in the meantime other properties have “copied” that BaseOutputPath and I can’t ‘fix’ them all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to avoid Visual Studio 2022 to add project ...
I know this is an old question, but here's the full solution based on Microsoft's Debugger Settings: Click on Project > [name of...
Read more >
MSBuild reference for .NET SDK projects
Setting AppendTargetFrameworkToOutputPath to false prevents the TFM from being appended to the output path. However, without the TFM in the ...
Read more >
Common MSBuild Project Properties
The file is put in the intermediate output path by the build process. This property specifies only file names that don't have path...
Read more >
Configuring-Visual-Studio-2022-output - WealthLab
Hello, I need help wit debugging. I've set the output path. Start VS as admin and WL8 is open. And I am getting...
Read more >
Configuration Options
When providing a function, it is called with three parameters (id, parent, isResolved) that can give you more fine-grained control: id is the...
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