For my project, I need to create programmatically a MVC solution and project.
I've already search and I've found a way to create a Console Application using Solution2 and EnvDTE80. This is the code :
string commonName = "ConsoleAppProg";
string csPrjPath = $"C:\\TestCreateProject\\{commonName}";
Type type = Type.GetTypeFromProgID("VisualStudio.DTE.15.0");
DTE dte = (DTE)Activator.CreateInstance(type, true);
Solution2 sln = (Solution2)dte.Solution;
sln.Create(csPrjPath, commonName);
sln.SaveAs(commonName + ".sln");
string csProjectTemplatePath = sln.GetProjectTemplate("ConsoleApplication.zip", "CSharp");
sln.AddFromTemplate(csProjectTemplatePath, $"{csPrjPath}\\{commonName}", commonName, false);
But I didn't find a way to create a MVC Project. Searching in the Extensions folder of the VS installation folder, I didn't find a "mvc.zip" or something else except ConsoleApplication and ClassLibrary.
I hope someone can help me with this problem!
Thank you in advance !