Partager via


ProjectRootElement.AddUsingTask Method

Adds a UsingTask element to the project.

MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Namespace:  Microsoft.Build.Construction
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

Syntax

'Declaration
Public Function AddUsingTask ( _
    name As String, _
    assemblyFile As String, _
    assemblyName As String _
) As ProjectUsingTaskElement
public ProjectUsingTaskElement AddUsingTask(
    string name,
    string assemblyFile,
    string assemblyName
)
public:
ProjectUsingTaskElement^ AddUsingTask(
    String^ name, 
    String^ assemblyFile, 
    String^ assemblyName
)
member AddUsingTask : 
        name:string * 
        assemblyFile:string * 
        assemblyName:string -> ProjectUsingTaskElement
public function AddUsingTask(
    name : String, 
    assemblyFile : String, 
    assemblyName : String
) : ProjectUsingTaskElement

Parameters

  • assemblyFile
    Type: System.String

    The file path to the assembly.

  • assemblyName
    Type: System.String

    The name of the assembly to load.

Return Value

Type: Microsoft.Build.Construction.ProjectUsingTaskElement
Returns the added UsingTask element.

Remarks

Either the assemblyName or assemblyFile must be null, but not both.

.NET Framework Security

See Also

Reference

ProjectRootElement Class

Microsoft.Build.Construction Namespace