HostsFile PropertiesMSBuild Extension Pack Help 4.0.12.0

The HostsFile type exposes the following members.

Properties

  NameDescription
Public propertyComment
The comment after the hosts entry. Only used by the SetHostEntry task action.
Public propertyHostEntries
The list of hosts entries. The identity should be the host name. The IP address should be in the IPAddress metadata. A comment about the entry should be in the Comment metadata. The task will fail if the identity or IPAddress metadata are empty.
Public propertyHostName
The hostname to alias. Only used by the SetHostEntry task action.
Public propertyIPAddress
The IP address for the hosts entry being aliased. Required. Only used by the SetHostEntry task action.
Public propertyPathToHostsFile
The path to the hosts file to update. Defaults to %SYSTEMROOT%\system32\drivers\etc\hosts. Task will fail if this file doesn't exist.
Public propertyTruncate
If True, any host entry not in the HostEntries item group will be removed from the hosts file. Default is False. Only used by the Update task action.
Top
See Also

Reference