WebClient Class | MSBuild Extension Pack Help 4.0.12.0 |
Valid TaskActions are:
DownloadFile (Required: Url, FileName Optional:Proxy, BypassOnLocalOutput: Response)
OpenRead (Required: Url Optional: DisplayToConsole, Proxy, BypassOnLocalOutput: Data)
Remote Execution Support: NA
Inheritance Hierarchy
MSBuild.ExtensionPackBaseTask
MSBuild.ExtensionPack.WebWebClient
Namespace: MSBuild.ExtensionPack.Web
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The WebClient type exposes the following members.
Constructors
Name | Description | |
---|---|---|
WebClient |
Properties
Name | Description | |
---|---|---|
BypassOnLocal |
Sets whether to bypass the proxy for local addresses. Default is false.
| |
Data |
Gets the Data downloaded.
| |
DisplayToConsole |
Sets whether to show Data to the console. Default is false.
| |
FileName |
Sets the name of the file
| |
Proxy |
Sets the URI of a proxy
| |
Url |
Sets the name of the Url. Required.
|
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"> <!-- Download a File--> <MSBuild.ExtensionPack.Web.WebClient TaskAction="DownloadFile" Url="http://hlstiw.bay.livefilestore.com/y1p7GhsJWeF4ig_Yb-8QXeA1bL0nY_MdOGaRQ3opRZS0YVvfshMfoZYe_cb1wSzPhx4nL_yidkG8Ji9msjRcTt0ew/Team%20Build%202008%20DeskSheet%202.0.pdf?download" FileName="C:\TFS Build 2008 DeskSheet.pdf"/> <!-- Download a File using a proxy to connect to the remote server --> <MSBuild.ExtensionPack.Web.WebClient TaskAction="DownloadFile" Url="http://download.sysinternals.com/Files/SysinternalsSuite.zip" FileName="MySysinternalsCopy.zip" Proxy="myproxy.fabrikam.com:8080"/> <!-- Get the contents of a Url--> <MSBuild.ExtensionPack.Web.WebClient TaskAction="OpenRead" Url="http://www.msbuildextensionpack.com"> <Output TaskParameter="Data" PropertyName="Out"/> </MSBuild.ExtensionPack.Web.WebClient> <Message Text="$(Out)"/> </Target> </Project>
See Also