ProjectItems::AddFromTemplate Method (String^, String^)
Visual Studio 2015
Creates a new project item from an existing item template file and adds it to the project.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- FileName
-
Type:
System::String^
Required. The full path and file name of the template project file.
- Name
-
Type:
System::String^
Required. The file name to use for the new project item.
When you call AddFromTemplate, there is no need to explicitly create a new solution (such as with DTE.Solution.Create), because AddFromTemplate automatically creates a solution.
Note |
|---|
The ProjectItems.AddFromTemplate method always returns null. In order to retrieve the added ProjectItem, you can interate through the ProjectItems collection, or use the ProjectItemEvents.ItemAdded event. |
Show:
