Adding files to .csproj programmatically

  • Thread starter Thread starter SD WinGirl
  • Start date Start date
S

SD WinGirl

Our project is set up so that .cs source files are automatically
generated.
I would like to automate the adding of the .cs source files to the
project (.csproj) file automatically.

Are there APIs or scripts that I can run to add the source files to
the project programmatically?
 
There's an automation interface to dev studio that may have the
functionality you are looking for. I use it to automate our build process,
and while I haven't tried to add a source file to the project I'd be
surprised if it didn't support it.

To access it via C# add a reference to the envdte assembly. This gives you
access to the DTE object and the envDte namespace. This object represents
the Visual Studio .NET automation model. You can get more information here:
http://msdn.microsoft.com/library/d...s/vsintro7/html/vxconreferencingdteobject.asp

Dave
 
Back
Top