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

How to create new Csharp Solution, Project programmatically ( EnvDTE ) ??

$
0
0

 

Hi,

 

          I am looking for the code that will create a new Solution and Add a C# project in the Solution. I know we can use the below code with the Add-ins project ..

But just want to know is this possible from the Console Application because I have tried a lot ..but getting an exception to create a new Solution ..

 

 

using EnvDTE;

using

EnvDTE80;

 

 

 

Solution soln = newSolution();// templates.

soln.Create(

"path","name");

 

or

 

Solution2 soln = (Solution2)dte.Solution;

 

 

csTemplatePath = soln.GetProjectTemplate("MyMainTemplate.zip", "CSharp");

soln.AddFromTemplate(csTemplatePath, csPrjPath, txtProjectName.Text.Trim(), false);

 

 

Help will be appreciated ...

 

 

 


Viewing all articles
Browse latest Browse all 4410

Trending Articles



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