project-system icon indicating copy to clipboard operation
project-system copied to clipboard

Introduce a UI option to "log design-time builds"

Open davkean opened this issue 8 years ago • 8 comments

In the new project system, similar to normal build warnings and errors, design-time build warnings and errors show up in the Error List. The idea here is for a few different reasons:

  1. It lets users a little more aware of the sorts of issues that break the design-time build, and hence the language service and other features that rely on it.

  2. It lets the project system get of the business of logging specific errors and warnings when references can't be found, are the wrong framework, etc. Instead, we just surface the actual MSBuild warnings/errors that come from the build.

This is great, however, when you get an error/warning there's not an easy way to turn on logging for these builds to figure out why these errors or warnings were logged. CPS does log these builds to the Output window if a specific registry key has been set - however, given the changes in the new installer to support side-by-side VS versions, this registry key now has be set in the privateregistry.bin in %APPDATA%. This is difficult to set, and has to be set every new VS instance that you install.

To simplify this, I propose we add a new option in Projects and Solutions -> Build and Run to set this registry key:

image

Optionally, we could also generalize this to turn on TRACEDESIGNTIME option for the legacy project system.

davkean avatar Feb 23 '17 05:02 davkean

Consider also adding this option: Checkbox: Log last 30 design-time builds to files Label: Location Textbox [...] (browse for folder button that lets you select a folder for logs, default to %temp%\VisualStudio\DesignTimeBuildLogs"

For each project being built in design-time, save the .binlog file to that folder. Only keep 30 most recent log files in that folder.

Since MSBuild is now getting BinaryLogger in the box: https://github.com/Microsoft/MSBuild/wiki/Binary-Log

It should be easy to instantiate and pass the logger.

KirillOsenkov avatar Jun 02 '17 05:06 KirillOsenkov

I've been having to debug design-time builds a lot recently, so being able to to enable/disable the design-time build output window from a Visual Studio option would be a much nicer experience.

I'd also like to be able to adjust the output verbosity separately from the regular build output.

bording avatar Aug 09 '17 03:08 bording

C++/CPS also wanted a separate verbosity in an offline thread I had with them.

davkean avatar Aug 09 '17 07:08 davkean

In general i'd like to have binlog option for build from VS (verbosity = "Minimal with binary log") - not just for design time builds.

image

tmat avatar Feb 19 '19 23:02 tmat

That would fit under build log file verbosity, right? (Which C# doesn't respect right now)

davkean avatar Feb 20 '19 00:02 davkean

Yes, that'd be reasonable. As long as I can get a binary log I don't care much what the exact setting is. It would be useful if the build output window printed out the path to the log file once the build is finished, so I don't need to hunt for it.

tmat avatar Feb 20 '19 00:02 tmat

4+ years later and crickets....

davidcorbin-atmosera avatar Apr 10 '23 15:04 davidcorbin-atmosera

@dcorbin-wintellect you might like to check out https://github.com/dotnet/project-system-tools

drewnoakes avatar Apr 12 '23 10:04 drewnoakes