NAnt SDK Documentation - v0.92 |

# AvailableTask Class

NOTE: This class is now obsolete.

Use functions instead.

Checks if a resource is available at runtime.

For a list of all members of this type, see AvailableTask Members.

System.Object
NAnt.Core.Element
NAnt.Core.Task
NAnt.Core.Tasks.AvailableTask

[Visual Basic]
<TaskName(Name:="available"), _ Obsolete(Message:="Use functions instead.", IsError:=False)>
Public Class AvailableTask
Inherits Task
[C#]
[TaskName(Name="available")]
[Obsolete(Message="Use functions instead.", IsError=False)]
public class AvailableTask : Task

#### Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

#### Remarks

The specified property is set to true if the requested resource is available at runtime, and false if the resource is not available.

> Note we advise you to use the following functions instead:

Function | Description
--- | ---
Exists | Determines whether the specified file exists.
Exists | Determines whether the given path refers to an existing directory on disk.
Exists | Checks whether the specified framework exists..
SdkExists | Checks whether the SDK for the specified framework is installed.

#### Example

Sets the `myfile.present` property to true if the file is available on the filesystem and false if the file is not available.

    <available type="File" resource="myfile.txt" property="myfile.present" />

Sets the `build.dir.present` property to true if the directory is available on the filesystem and false if the directory is not available.

    <available type="Directory" resource="build" property="build.dir.present" />

Sets the `mono-0.21.framework.present` property to true if the Mono 0.21 framework is available on the current system and false if the framework is not available.

    <available type="Framework" resource="mono-0.21" property="mono-0.21.framework.present" />

Sets the `net-1.1.frameworksdk.present` property to true if the .NET 1.1 Framework SDK is available on the current system and false if the SDK is not available.

    <available type="FrameworkSDK" resource="net-1.1" property="net-1.1.frameworksdk.present" />

#### Requirements

Namespace: NAnt.Core.Tasks

Assembly: NAnt.Core (in NAnt.Core.dll)

#### See Also

AvailableTask Members | NAnt.Core.Tasks Namespace