Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug a project file in MSBuild 14.0 / VS2015?

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.

like image 342
weir Avatar asked Feb 08 '17 15:02

weir


People also ask

How do I debug existing project in Visual Studio?

Launch configurations# To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and VS Code will try to run your currently active file.

What is debug and release build?

Debug mode and Release mode are different configurations for building your . Net project. Programmers generally use the Debug mode for debugging step by step their . Net project and select the Release mode for the final build of Assembly file (. dll or .exe).


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.

like image 175
Rainer Sigwald Avatar answered Oct 03 '22 04:10

Rainer Sigwald


It really works well in old VS version:

enter image description here

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:

https://connect.microsoft.com/VisualStudio/feedbackdetail/view/3120913/how-to-debug-a-project-file-in-msbuild-14-0-vs2015

You could check the latest update from it, of course, please also vote and add your comment there:)

like image 39
Jack Zhai-MSFT Avatar answered Oct 03 '22 02:10

Jack Zhai-MSFT