views:

209

answers:

3

I want to write a wizard in .net which programmatically generates Visual Studio Solution with some projects. I will have a XML file with details of files need to be included in the project with their respective paths to fetch them and a list of project names. Is there any way I can achieve this

A: 

Check out the Text Template Transformation Toolkit (T4). It's pretty sweet, and powers some of the file generation in ASP.NET MVC. Scott Hanselman's got a great introductory article on the topic.

alastairs
After hours long google i found this link http://goo.gl/ZQhV I think this will help me in setting up the automated Visual Studio solution generation.
Krishnaraj Barvathaya
One more option I found in Codeplex http://goo.gl/40Lf
Krishnaraj Barvathaya
Your first link is to MSDN documentation for Visual Studio extensions and add-ins, so won't help you in building a standalone solution (as you stated you required). You may have more luck with the Tree Surgeon project, although it looks like it has set rules on where to put things and so may not fulfil your requirements.
alastairs
A: 

Well the Visual Studio SDK would be your path to go. There are methods where you can create files and I think also projects based on project templates. So for instance you can create a new "asp.net mvc" project or a class library. You could even create your own template.

I am quite sure that you can do this only inside VS.

Otherwise, there is nothing wrong to generate the project and sln files be generating the xml files, thats one of the good things that they are plain xml in the end. You just need to generate some Projectd Guids, but I think this would be fairly simple and totally "legal".

good progress!

A: 

I would look into doing it by issuing commands to the "Visual Studio Command Prompt". I don't know exactly how to create a solution in it, but there are a lot of things it can do like command-line debugging and Team-Foundation updates.

Wyatt