In my last blog post, I talked about design-time builds and why you should care about them. But one of the biggest problems with design-time builds is that they are invisible. They run in the background and you don’t get any feedback that anything is going on (except, maybe, that Visual Studio seems to be a bit slower while they run). And if they fail, there’s no way to determine that that happened and no way to determine what went wrong.
To address some of these issues, the project system team has now published a new Visual Studio extension that can help: Project System Tools. This extension is a place where the project system team can add tools that make working with the project system better. The first tool that we’ve added to the extension is the Build Logging tool window. When you pull down the View menu item, under “Other Windows” there will now be a “Build Logging” choice. If you choose that you’ll see a tool window come up:
When you hit the “play” button on the toolbar, the build logging window will start recording build logs for all builds that happen in Visual Studio, including design-time builds! In the window, you’ll be able to see:
- The project that was built
- The type of project (csproj, vbproj, etc.)
- The “dimensions” of the build (x86, AnyCPU, Debug, Release, etc.)
- The top-level targets that were built
- Whether the build was a design-time build
- Start time and elapsed time
- Whether build succeeded or failed (or is still running, for that matter)
The build logs are saved in the new MSBuild binary log format. If you double-click on a build log entry, we’ll try and open the binlog file using whatever viewer is registered. (I suggest installing Kirill Osenkov’s MSBuild Log Viewer) You can also right-click on the log and save it to a location of your choice, which can be handy for passing around build logs.
One thing to note is that because the Build Logging window depends on new APIs that were added to Visual Studio in the 15.4 release, you will only be able to install the extension on the most up-to-date version of Visual Studio 15 (or one of the Preview builds).
Try it out and let us know what you think! The project system tools are open source, so you can contribute to them if you go to our repo: https://github.com/dotnet/project-system-tools. We also have some more ideas of things to add, so stay tuned!
You can also follow me on Twitter here.
I get “Exception has been thrown by the target of an invocation” when trying to view the window.
I pushed a fix for this before the Christmas break, let me know if it’s still not working!