Freigeben über


IVsSolution6.AddNewProjectFromTemplate Method

Adds a new project to the solution, using a project template.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.12.1.DesignTime (in Microsoft.VisualStudio.Shell.Interop.12.1.DesignTime.dll)

Syntax

'Declaration
Function AddNewProjectFromTemplate ( _
    szTemplatePath As String, _
    rgCustomParams As Array, _
    szTargetFramework As String, _
    szDestinationFolder As String, _
    szProjectName As String, _
    pParent As IVsHierarchy, _
    <OutAttribute> ByRef ppNewProj As IVsHierarchy _
) As Integer
int AddNewProjectFromTemplate(
    string szTemplatePath,
    Array rgCustomParams,
    string szTargetFramework,
    string szDestinationFolder,
    string szProjectName,
    IVsHierarchy pParent,
    out IVsHierarchy ppNewProj
)
int AddNewProjectFromTemplate(
    [InAttribute] String^ szTemplatePath, 
    [InAttribute] Array^ rgCustomParams, 
    [InAttribute] String^ szTargetFramework, 
    [InAttribute] String^ szDestinationFolder, 
    [InAttribute] String^ szProjectName, 
    [InAttribute] IVsHierarchy^ pParent, 
    [OutAttribute] IVsHierarchy^% ppNewProj
)
abstract AddNewProjectFromTemplate : 
        szTemplatePath:string * 
        rgCustomParams:Array * 
        szTargetFramework:string * 
        szDestinationFolder:string * 
        szProjectName:string * 
        pParent:IVsHierarchy * 
        ppNewProj:IVsHierarchy byref -> int
function AddNewProjectFromTemplate(
    szTemplatePath : String, 
    rgCustomParams : Array, 
    szTargetFramework : String, 
    szDestinationFolder : String, 
    szProjectName : String, 
    pParent : IVsHierarchy, 
    ppNewProj : IVsHierarchy
) : int

Parameters

  • szTemplatePath
    Type: String

    The path of the template.

  • rgCustomParams
    Type: Array

    [optional] Custom keywords to pass to the template engine. Strings must have the form "keyword=value".

  • szTargetFramework
    Type: String

    [optional] The target framework (if applicable) for template selection.

  • szDestinationFolder
    Type: String

    The location on disk where the project will be created.

  • szProjectName
    Type: String

    The name of the project.

Return Value

Type: Int32
The newly created project. If the template creates more than one project, this one is the first one created.

.NET Framework Security

See Also

Reference

IVsSolution6 Interface

Microsoft.VisualStudio.Shell.Interop Namespace