Valid TaskActions are:

GetDnsHostName (Required: HostNameOutput: DnsHostName)

GetInternalIP (Output: Ip)

GetRemoteIP (Required: HostName Output: Ip)

Ping (Required: HostName Optional: Timeout, PingCount Output: Exists)

Remote Execution Support: NA

Namespace: MSBuild.ExtensionPack.Computer
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 3.5.0.0

Examples

Xml Copy imageCopy
<Project ToolsVersion="3.5" 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 the Machine IP Addresses -->
    <MSBuild.ExtensionPack.Computer.Network TaskAction="GetInternalIP">
      <Output TaskParameter="IP" ItemName="TheIP"/>
    </MSBuild.ExtensionPack.Computer.Network>
    <Message Text="The IP: %(TheIP.Identity)"/>
    <!-- Get Remote IP Addresses -->
    <MSBuild.ExtensionPack.Computer.Network TaskAction="GetRemoteIP" HostName="www.freetodev.com">
      <Output TaskParameter="IP" ItemName="TheRemoteIP"/>
    </MSBuild.ExtensionPack.Computer.Network>
    <Message Text="The Remote IP: %(TheRemoteIP.Identity)"/>
    <!-- Ping a host -->
    <MSBuild.ExtensionPack.Computer.Network TaskAction="Ping" HostName="www.freetodev.com">
      <Output TaskParameter="Exists" PropertyName="DoesExist"/>
    </MSBuild.ExtensionPack.Computer.Network>
    <Message Text="Exists: $(DoesExist)"/>
    <!-- Gets the fully-qualified domain name for a hostname. -->
    <MSBuild.ExtensionPack.Computer.Network TaskAction="GetDnsHostName" HostName="192.168.0.15">
      <Output TaskParameter="DnsHostName" PropertyName="HostEntryName" />
    </MSBuild.ExtensionPack.Computer.Network>
    <Message Text="Host Entry name: $(HostEntryName)" />
  </Target>
</Project>

Inheritance Hierarchy

System..::..Object
  Microsoft.Build.Utilities..::..Task
    MSBuild.ExtensionPack..::..BaseTask
      MSBuild.ExtensionPack.Computer..::..Network

See Also