Cake.Issues.MsBuild

The MsBuild support for the Cake.Issues addin allows you to read issues logged as warnings in a MsBuild log. This addin provides the aliases for reading MsBuild warnings and providing them to the Cake.Issues addin. It also requires the core Cake.Issues addin. There are also additional addins for generating reports or posting issues to pull requests. See cakeissues.net for an overview of the whole ecosystem of addins for working with issues in Cake scripts.

#addin nuget:?package=Cake.Issues.MsBuild&version=4.3.0

dotnet add package Cake.Issues.MsBuild --version 4.3.0

<PackageReference Include="Cake.Issues.MsBuild" Version="4.3.0" />

Aliases

Contains functionality for reading warnings from MSBuild log files. NOTE: Use Cake.Issues.MsBuild addin to use these aliases with Cake Script Runners and Cake.Frosting.Issues.MsBuild to use these aliases with Cake Frosting.

Issue Providers

MsBuildAddRuleUrlResolver(Func<MsBuildRuleDescription, Uri>, int) Registers a new URL resolver with a specific priority.
MsBuildAddRuleUrlResolver(Func<MsBuildRuleDescription, Uri>) Registers a new URL resolver with default priority of 0.
MsBuildBinaryLogFileFormat Gets an instance for the MsBuild binary log format.
MsBuildIssues(MsBuildIssuesSettings) Gets an instance of a provider for issues reported as MsBuild warnings using specified settings.
MsBuildIssuesFromContent(string, BaseMsBuildLogFileFormat) Gets an instance of a provider for issues reported as MsBuild warnings using log content.
MsBuildIssuesFromFilePath(FilePath, BaseMsBuildLogFileFormat) Gets an instance of a provider for issues reported as MsBuild warnings using a log file from disk.
MsBuildIssuesProviderTypeName Gets the name of the MsBuild issue provider. This name can be used to identify issues based on the ProviderType property.
MsBuildXmlFileLoggerFormat

Gets an instance for the MsBuild log format as written by the XmlFileLogger class from MSBuild Extension Pack.

You can add the logger to the MSBuildSettings like this:

var settings = new MSBuildSettings()
    .WithLogger(
        Context.Tools.Resolve("MSBuild.ExtensionPack.Loggers.dll").FullPath,
        "XmlFileLogger",
        string.Format(
            "logfile=\"{0}\";verbosity=Detailed;encoding=UTF-8",
            @"c:\build\msbuild.log")
    );

In order to use the above logger, include the following in your build.cake file to download and install from NuGet.org:

#tool "nuget:?package=MSBuild.Extension.Pack"