Search code examples
visual-studiovisual-studio-extensions

Visual Studio Project Template - TemplateContent Populated by Code


I'm trying to create a Visual Studio Project Template but I don't wish to manually populate the TemplateContent section. Ideally it would fire off a C# script when it tries to create the template's zip file. I was wondering if there are any hooks built in to allow you to do this?


Solution

  • I'm trying to create a Visual Studio Project Template but I don't wish to manually populate the TemplateContent section. Ideally it would fire off a C# script when it tries to create the template's zip file. I was wondering if there are any hooks built in to allow you to do this?

    As far as I know, Microsoft does not provide related API to handle TemplateContent section, but we know that TemplateContent section is a node of XML. We could populate the TemplateContent section by using LINQ to XML.