How to debug a project file in MSBuild 12.0 / VS2013? has an answer, but apparently that method is not supported in Visual Studio 2015/MSBuild 14. Does anyone know a way to perform MSBuild debugging in Visual Studio 2015/MSBuild 14? Bonus points for scoop about Visual Studio 2017.
2 Answers
The MSBuild debugger was never officially supported and was cut from MSBuild in favor of cross-platform support in the VS 2015/MSBuild 14 timeframe.
There are many ways to debug the behavior of a build. The combination of a Verbosity=Diagnostic
build log and the preprocessed project (msbuild /pp:preprocessed.xml path\to\the.csproj
creates a file containing all of the build logic for a given project) is extremely powerful. You may also be interested in the UI that the MSBuildStructuredLog provides, which helps pare down the massive output produced by a diagnostic log.

- 765
- 5
- 9
-
Agreed-- debugger-less debugging is doubtlessly doable. And thanks for the tip on [MSBuildStructuredLog](https://github.com/KirillOsenkov/MSBuildStructuredLog). I have occasionally used [MSBuildExplorer](https://github.com/bryanar/MSBuildExplorer) to aid static analysis of MSBuild scripts, but this looks like it may really speed (post-execution) debugging. This feature particularly excites me: _"Displays double-writes (when files from different sources are written to the same destination during a build, thus causing non-determinism)."_ – weir Feb 10 '17 at 20:43
It really works well in old VS version:
But if I use the VS2015, I got the same issue as yours, it could recognize the /debug command line.
I report this issue to the product team here:
You could check the latest update from it, of course, please also vote and add your comment there:)