HostsFile Properties

MSBuild Extension Pack

HostsFile Properties MSBuild Extension Pack Help 4.0.12.0

The HostsFile type exposes the following members.

Properties

  Name Description
Public property Comment
The comment after the hosts entry. Only used by the SetHostEntry task action.
Public property HostEntries
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 property HostName
The hostname to alias. Only used by the SetHostEntry task action.
Public property IPAddress
The IP address for the hosts entry being aliased. Required. Only used by the SetHostEntry task action.
Public property PathToHostsFile
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 property Truncate
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