Last post Jun 02, 2017 06:09 AM by EvenMa
Jun 01, 2017 09:02 AM|Rajesh Mishra|LINK
I have a Web API project which have some classes for exception handling, response formats and other handlers. Also, I have reference to 2 class libraries(Business and DAL layer).
I create this solution repeatedly for different projects. How can I automate this process to create the solution which have a Web API project with some classes, 2 class libraries.
I did some research and saw I can create project templates. But I did not find good article for my task.
If anyone can help me with some direction towards solving it.
Type type = Type.GetTypeFromProgID("VisualStudio.DTE.11.0");
var visualStudio = Activator.CreateInstance(type, true);
var dte = visualStudio.Instance;
var solution = (Solution2)dte.Solution;
string templateFile = solution.GetProjectTemplate(applicationProjectTemplateName);
var project = solution.AddProjectFromTemplate(projectName, DestinationFolder, templateFile);
I found above code which I can use but I dont understand
Solution2, and "applicationProjectTemplateName" parameter value in following:
Jun 01, 2017 09:34 AM|Mikesdotnetting|LINK
Try this: https://docs.microsoft.com/en-gb/visualstudio/ide/how-to-create-project-templates
Jun 02, 2017 06:09 AM|EvenMa|LINK
Hi Rajesh Mishra,
According to your description, you could use the feature of export template in visual studio to implement it, and then use visual studio package to package the template, after above, you could generate a file of VSIX install, then you could use it to install
your template on any computers.
Here has example, you could refer to the following link.
If you have any other questions, please feel free to contact me any time.