views:

226

answers:

1

I'm currently working on an application that will generate actual .cs and .xaml code files and add them to a project. I've managed to do this by manually editing an existing .csproj file and thats working well.

However I would like to be able to create the project files from my application as well, to cut out the extra step of creating the project first then running the application after.

Does anyone know how to create a C# project (class library, or WPF Application) from an application? I've looked into DTE, but I've hit a wall

A: 

I can't give a complete answer, but maybe I can point you in the right direction.

One avenue to explore in your own searching is MSBuild. C# and VB.net project files follow the msbuild format, and so the first step in building a valid project file is building a valid msbuild file.

Also, it sounds like you're doing something a little different, but have you looked at the T4 system for code generation?

Joel Coehoorn
yes, I've looked into T4, but could not figure out how to use it from my application. I was only ever able to make in run inside the visual studio environment. My solution seems easier to me anyways, without needing to learn a new syntax. I will look into this MSBuild idea next
Shaboboo