Modifying csproj or vbproj files like LLBLGen

Posts   
 
    
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 07-Jan-2008 20:55:50   

Hi Frans,

Hopefully, you'll see the post even though it's in the General Chat forum.

Anyway, I have a need to create an application that will add/remove files from a vbproj or csproj file. Since LLBLGen does this really well, I was curious what technique you use.

Do you open the file as XML and modify it that way? Or do you use a token based approach with LLBLGen's built in code generator? Or maybe you use the DTE automation objects? etc....

Thanks for the tip!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Jan-2008 09:24:29   

alexdresko wrote:

Hi Frans,

Hopefully, you'll see the post even though it's in the General Chat forum.

Anyway, I have a need to create an application that will add/remove files from a vbproj or csproj file. Since LLBLGen does this really well, I was curious what technique you use.

Do you open the file as XML and modify it that way? Or do you use a token based approach with LLBLGen's built in code generator? Or maybe you use the DTE automation objects? etc....

Thanks for the tip!

Download the SDK sourcecode and you'll know it smile

It's done using XML. I load the project file as XML into an XML dom and then find the parent element for the files, then clear it and add new nodes to it simple_smile

Frans Bouma | Lead developer LLBLGen Pro