Skip to content

Reading Compiler invocations

Kirill Osenkov edited this page May 27, 2020 · 2 revisions

Reading compiler invocations from a .binlog

https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/master/src/StructuredLogger/Analyzers/CompilerInvocations.cs

The technique described here can be used to read accurate information from binlogs and feed it to a Roslyn Workspace for example: https://github.com/KirillOsenkov/SourceBrowser/wiki/Indexing-.binlogs

This API is available in this NuGet Package: https://www.nuget.org/packages/MSBuild.StructuredLogger/2.1.133

Example:

using Microsoft.Build.Logging.StructuredLogger;

...

CompilerInvocationsReader.ReadInvocations(string binlogFilePath)