Server Class

MSBuild Extension Pack

Server Class MSBuild Extension Pack Help 4.0.12.0
Valid TaskActions are:

GetConnectionCount (Optional: NoPooling Output: ConnectionCount)

GetInfo (Optional: NoPooling Output: Information)

Remote Execution Support: Yes

Inheritance Hierarchy

SystemObject  Microsoft.Build.UtilitiesTask
    MSBuild.ExtensionPackBaseTask
      MSBuild.ExtensionPack.Sql2014Server

Namespace: MSBuild.ExtensionPack.Sql2014
Assembly: MSBuild.ExtensionPack.Sql2014 (in MSBuild.ExtensionPack.Sql2014.dll) Version: 4.0.0.0

The Server type exposes the following members.

Constructors

  NameDescription
Public methodServer
Top
Properties

  NameDescription
Public propertyConnectionCount
Gets the number of connections the server has open
Public propertyInformation
Gets the Information TaskItem. Each available property is added as metadata.
Public propertyNoPooling
Set to true to create a NonPooledConnection to the server. Default is false.
Top
Examples

<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <Target Name="Default">
        <!-- Get information for a server, not that this defaults to the default instance on the local server -->
        <MSBuild.ExtensionPack.Sql2014.Server TaskAction="GetInfo">
            <Output TaskParameter="Information" ItemName="AllInfo"/>
        </MSBuild.ExtensionPack.Sql2014.Server>
        <!-- All the server information properties are available as metadata on the Infomation item -->
        <Message Text="PhysicalMemory: %(AllInfo.PhysicalMemory)"/>
        <!-- Get all the active connections to the server -->
        <MSBuild.ExtensionPack.Sql2014.Server TaskAction="GetConnectionCount">
            <Output TaskParameter="ConnectionCount" PropertyName="Count"/>
        </MSBuild.ExtensionPack.Sql2014.Server>
        <Message Text="Server ConnectionCount: $(Count)"/>
    </Target>
</Project>
See Also

Reference