TeamCityDisposableExtensions.

Block(ITeamCityProvider, string) Method

Summary

Writes the start of a TeamCity message block, then returns a disposable that writes the report block end on dispose.

Syntax

public static IDisposable Block(this ITeamCityProvider teamCityProvider, string blockName)

Examples

if (BuildSystem.TeamCity.IsRunningOnTeamCity)
{
    using (BuildSystem.TeamCity.Block("Restore"))
    {
        Information("Restoring packages");
    }
}
if (TeamCity.IsRunningOnTeamCity)
{
    using (TeamCity.Block("Restore"))
    {
        Information("Restoring packages");
    }
}

Parameters

Name Type Description
teamCityProvider ITeamCityProvider TeamCity provider.
blockName string The name of the report block.

Return Value

Type Description
IDisposable A disposable that writes the report block end.