EnvDTE - Arguments for command File.ExportTemplate

Category: visual studio extensibility

Question

Jean-Baptiste Lafage on Wed, 06 Jan 2016 11:57:31


Hello,

Do you know which arguments are available with command File.ExportTemplate from EnvDTE?
Is there a possibility to pre-select the project from the dropdown list (from the wizard) that you want to export when you have a solution including several projects?

Example:



Replies

Jack Zhai-MSFT on Thu, 07 Jan 2016 07:39:45


Hi Jean-Baptiste Lafage,

Since this issue was related to the VS extension, I help you move this case to the Visual Studio Integrate forum for dedicated support.

Thanks,

Jack

DotNet Wang on Fri, 08 Jan 2016 02:09:41


Hi Jean-Baptiste Lafage,

>>Is there a possibility to pre-select the project from the dropdown list (from the wizard) that you want to export when you have a solution including several projects?

Visual Studio doesn't provide such apis. I am afraid you need to implement the steps by yourself.  Steps below are for your reference.

  • Copy the project files.

  • Edit the code files to indicate where parameter replacement should take place. For more information about parameter replacement, see How to: Substitute Parameters in a Template.

  • Create an XML file and save it as MyTemplate.vstemplate file in the same directory as your project, but do not add it to the project in Visual Studio.

  • Author MyTemplate.vstemplate file to provide project template metadata. For more information, see the example in the following section.

  • Select the files in your template (including the .vstemplate file), right-click them, click Send To, and then click Compressed (zipped) Folder. The files that you previously extracted are compressed into a .zip file.

  • Put the .zip template file in the Visual Studio project template directory. This directory is under the Visual Studio installation directory and is called, Templates\ProjectTemplates\.

Best Regards,
Li Wang