Vano Maisuradze
Vano Maisuradze

Reputation: 5899

How to create solution with multiple projects programmatically?

I want to create solution with multiple projects.

I think I have three options:

  1. EnvDTE
  2. Microsoft.Build
  3. Manually create *.sln and *.csproj files

I googled but didn't found good examples for 1 and 2 options (I mean how to create solution, add projects, add refereces, add new or existing project items, etc...)

third option, I think, is easier but if there are good options, I don't need to create projects manually.

So my questions are:

Is there any other options to create projects programmatically?

and Which option is better?

Thanks.

Upvotes: 3

Views: 1974

Answers (1)

David Anderson
David Anderson

Reputation: 13680

Just manually create the sln and csproj files (and other required files) manually, the formats are very simple. You can make this an easy task by creating a new solution with two projects in Visual Studio, and just inspecting the contents of the sln and csproj files. The idea here is that you are just making yourself a template.

Upvotes: 2

Related Questions