Following my previous post about ILRepack, some people asked me where the MSBuild property
ReferencePathWithRefAssemblies comes from. Is there a documentation, or something to find properties like this one? The documentation of MSBuild is very useful to understand how it works and the key concepts. However, they cannot document all the properties because there are dependents of the kind of project you build and the targets that run. The solution to find properties is to look at the log of the build. The textual log is not very readable and very long. However since MSBuild 15.3, you can output a binary log that you can open with MSBuild Binary and Structured Log Viewer. Let's see how to generate a binary log and use the tool to find what you want.
Generating a log using the command line
- Open the console with MSBuild in the path:
/blflag to generate the binary log:
msbuild solution.sln /bl
It outputs a file named
Generating a log using Visual Studio
- Install the Visual Studio extension: Project System Tools
- Open the tool window under
View > Other Windows > Build Logging
- Click the button
Start logging builds
- Open the log
Viewing the log
Install MSBuild Binary and Structured Log Viewer, and then open the file in the tool.
The tool allows you to view the list of steps of the build with the input and output parameters of each target. You can also view the xml code of the project to view where the target is defined.
You can also search for something in all the log
This tools allows you to understand MSBuild and find useful data to write your build script. It's a must have in your toolbox.