I want to programmatically add class files to a c# project. Right now I’m thinking the fastest route may be to simply edit the xml file directly but I know there are api’s for working with the project.
The thing is that I want to run an exe that just updates the file. I don’t want to have to have the target project open in Visual Studio which is what it seems like is necessary with the automation interfaces used by add-ins.
So does anyone know how to do this with an api or am I stuck with working directly with the xml?
There is comprehensive support for T4 files which allow you programmatically generate files in the project, good example is Entity Framework templates for Self-Tracking entities and POCO, which you can get in the VS Gallery.
Also there are several good editors for T4 which allow you to have intellisence while editing templates