I create Visual Studio C++ project programmatically. I build it by Solution2.SolAddFromTemplate() method:
//Create VS IDE
Type visualStudioType=Type.GetTypeFromProgID("VisualStudio.DTE.10.0");
DTE dte = (DTE)Activator.CreateInstance(visualStudioType, true);
//Create a solution, based on project template.
Solution2 solution = (Solution2)dte.Solution;
**solution.AddFromTemplate(TemplatePath,DestinationPath, ProjectNane, true);**
This code is run successfully, but when I try to create Visual Studio 2012 project, by replace the type of Visual Studio to Visual Studio 2012:
Type visualStudioType=Type.GetTypeFromProgID("VisualStudio.DTE.11.0");
instead of:
Type visualStudioType=Type.GetTypeFromProgID("VisualStudio.DTE.10.0");
It's failed in the mark line (in call to AddFromTemplate()
), with the exception:
Default.js or default.vbs not found in C:\Users\UserName\Documents\Visual Studio 2012\Projects
I didn't find any help about this issue. Can anyone help me to solve that?