Create a .net solution outside the VS

AlexCode

Senior Contributor
Joined
Jul 7, 2003
Messages
931
Location
Portugal
Hi!

I need to know how do I create a .net Solution outside the Visual Studio Environment.

Want to be able to create the whole thing:
- Create the Solution
- Create Projects and add them to the Solution
- Add *.cs files to the projects
- Add references to the projects

the whole pack... :)

Thanks!
Alex :p
 
For what you're trying to do you really do not need solution files (.sln) as they are a Visual Studio specific thing.

.csproj files however are just XML documents. Open one up in notepad or something of the like and you can easily infer the layout and how to add files, references, etc programmatically. Just load the .csproj file into an XmlDocument instance and you can add new nodes, etc. With .NET 2.0 you can use MSBuild to programmatically compile projects. You do this by calling particular targets in the .csproj file via a command line switch. It is really pretty easy. There are also several managed namespaces for accessing various parts of MSBuild. Have a look around for MSBuild and you will find numerous examples.
 
Back
Top