SolutionFolder::AddFromTemplate Method (String^, String^, String^)

 

Adds a new project to the solution folder based on a project template.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Project^ AddFromTemplate(
	String^ FileName,
	String^ Destination,
	String^ ProjectName
)

Parameters

FileName
Type: System::String^

The full path of the project template.

Destination
Type: System::String^

This is the full path to a directory in which to copy the FileName contents.

ProjectName
Type: System::String^

The name of the new project to be created.

Return Value

Type: EnvDTE::Project^

A Project object.

This call fails if the new project file name already exists in the destination.

This example creates a new solution folder and adds a project to it from an existing file. It also adds a project from a template. Before running this example, create a "Projects" folder off your main drive ("C:" in this example), and create a Visual C# class library project, named "ClassLibrary1" in that folder. You must also create a folder named "MyCSProject" in the "Projects" folder. Open a project in the Visual Studio integrated development environment (IDE) before running this example.

No code example is currently available or this language may not be supported.
Return to top
Show: