Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to create a project dynamically

$
0
0

Hi,

I need to create project dynamically. I have used the below code,

Solution2 soln = (Solution2)dte.Solution; soln.Create(solpath, replacementsDictionary["$safeprojectname$"]); string path = soln.GetProjectTemplate("SubTemplate1\\MVC3CSRazor.vstemplate", "CSharp");

soln.AddFromTemplate(path,_projectPath,replacementsDictionary["$safeprojectname$"],false);

But it should be thrown the file not found exception.

If I use this code for template creation 

string pp1 = soln.GetProjectTemplate("MyTemplate.vstemplate", "CSharp");

The exception is not occurred. It get the template from this location ,

C:\\Users\\<UserName>\\AppData\\Roaming\\Microsoft\\VisualStudio\\11.0Exp\\ProjectTemplatesCache\\Visual C#\\xxx\\xxx.MVC4.CS.Razor.zip\\MyTemplate.vstemplate

This is wrong location. How to point out my template location in the GetProjectTemplate() Method ?

Thanks,

Abbas K


- Abbas K


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>