Freigeben über


ProjectRootElement.CreateUsingTaskElement Method (String, String, String, String, String)

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 CreateUsingTaskElement ( _
    taskName As String, _
    assemblyFile As String, _
    assemblyName As String, _
    runtime As String, _
    architecture As String _
) As ProjectUsingTaskElement
public ProjectUsingTaskElement CreateUsingTaskElement(
    string taskName,
    string assemblyFile,
    string assemblyName,
    string runtime,
    string architecture
)
public:
ProjectUsingTaskElement^ CreateUsingTaskElement(
    String^ taskName, 
    String^ assemblyFile, 
    String^ assemblyName, 
    String^ runtime, 
    String^ architecture
)
member CreateUsingTaskElement : 
        taskName:string * 
        assemblyFile:string * 
        assemblyName:string * 
        runtime:string * 
        architecture:string -> ProjectUsingTaskElement
public function CreateUsingTaskElement(
    taskName : String, 
    assemblyFile : String, 
    assemblyName : String, 
    runtime : String, 
    architecture : String
) : ProjectUsingTaskElement

Parameters

  • assemblyFile
    Type: System.String

    The file path to the assembly.

  • assemblyName
    Type: System.String

    The name of the assembly to load.

  • architecture
    Type: System.String

    Optional architecture specifier.

Return Value

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

Remarks

Caller must add the UsingTask element to the location of choice in the project. Either the assemblyName or assemblyFile must be null, but not both. Both the runtime and architecture can be null.

.NET Framework Security

See Also

Reference

ProjectRootElement Class

CreateUsingTaskElement Overload

Microsoft.Build.Construction Namespace