Create item from Item Template programmatically in Visual Studio

158 views Asked by At

I am developing a VS extension called WebLink, that replaces integrated VS browser.

I'd like to create a command, which would do the following, if a solution is loaded:

  1. If current solution does not have a folder named "Links" at the top level, create it.
  2. Create a new file in that folder, using an Item Template I ship with my extension, named new tab XX.website (the file should be placed in SolutionDir\Links\ )
  3. Open that file in the document well

My problem is with 2: how do I get VS to create a new file, and use the specified item template for it?

0

There are 0 answers