You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pulling my hair out trying to get Visual Studio and MSBuild to agree on where build output should be stored, using any combination of OutputPath and OutDir that I could come up with.
Edit: turns out that there is a third property that controls the build output: WebProjectOutputDir.
I realize that this is not a help forum. I briefly considered asking a question about it on StackOverflow, but 72 others have done so before me, leaving empty-handed most of the time.
There is a huge number of scenarios that require relocating the build output, but there is no reliable way to do that. For example: IIS Express stops working when you change the OutputPath of a web application project (could you believe it?).
Someone even got mad enough over OutputPath and OutDir to write a blog post about it: I hate you, OutDir parameter
Please explain how OutputPath and OutDir were intended to be used, in the context of continuous integration builds.
Reacted by Nathan Phillip Brink, Luke Carrier, scharnyw, Alex Reinking, darshanapatel111, nawfalhasan, VerdonTrigance, Daniel Elkington, Ruairidh MacLeod, reijerh and 5 more
Team triage: We also agree that this is unfortunate, but we need to be conservative on this because of legacy issues. This is not something we plan to address at this time.
Reacted by Dickson Souza
Reacted by Luke Carrier, Berkan Y., nawfalhasan, Daniel Elkington, build-space, Thomas Fulle, ejsealms, Mikhail Tyukin, martingalvan-volue, nulldg and 1 more
Reacted by Luke Carrier, Thomas Fulle, ejsealms and Jared Thirsk
To expand on what @AndyGerlicher said, we can't do what you're asking because we too have lost the reasoning behind this decision. The current team thinks it looks pretty broken.
From comments in the targets
OutDir and OutputPath are distinguished for legacy reasons, and OutDir should be used if at all possible.
It seems like we got stuck in the middle of a transition. However, as you've discovered, there's a ton of MSBuild code out there that exploits the differences between the two variables. That keeps us from completing the transition (or for that matter backing it out), because it would cause a lot of churn in customer projects.
Reacted by Nathan Phillip Brink, Luke Carrier, Lukas Juhrich, martingalvan-volue and Alexander Komarov
Activity
AndyGerlicher commentedon May 12, 2015
Team triage: We also agree that this is unfortunate, but we need to be conservative on this because of legacy issues. This is not something we plan to address at this time.
rainersigwald commentedon May 13, 2015
To expand on what @AndyGerlicher said, we can't do what you're asking because we too have lost the reasoning behind this decision. The current team thinks it looks pretty broken.
From comments in the targets
It seems like we got stuck in the middle of a transition. However, as you've discovered, there's a ton of MSBuild code out there that exploits the differences between the two variables. That keeps us from completing the transition (or for that matter backing it out), because it would cause a lot of churn in customer projects.
sliekens commentedon May 13, 2015
Thanks for taking time to look at this. I really appreciate it.
The way that seems to work best is to keep the
OutputPaththat is generated by Visual Studio, then set theOutDiras a command argument.michael-freidgeim-webjet commentedon Jan 22, 2017
I found that for Asp.Net Core only OutputPath parameter is working, and in mixed .net 4.61/Core solutions OutDir command argument should be avoided. See my post OutDir vs OutputPath for Visual studio 2015 and Asp.Net Core
JunielKatarn commentedon Mar 17, 2017
@rainersigwald Sorry, I didn't really get it. Which one should I use (new project, no legacy dependencies).
arivoir commentedon Oct 16, 2017
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>Worked for me