GoFightNguyen
GoFightNguyen

Reputation: 3

Visual Studio - Create an Item Template that shows up in the Add New Item dialog for the solution

Visual Studio 2017

I created an Item Template for Visual Studio. When installing the template or running the solution locally, the template only shows up in the Add New Item dialog for a C# project.

I want it to be in the Add New Item dialog for the solution.

It seems to me the problem is having the ProjectType set to CSharp in the .vstemplate file, but I don't know what to set it to. According to the docs the options are only CSharp, VisualBasic, and Web.

Upvotes: 0

Views: 1837

Answers (1)

Leo Liu
Leo Liu

Reputation: 76730

Visual Studio - Create an Item Template that shows up in the Add New Item dialog for the solution

Item template/Project template are for projects rather than solutions and belongs to a specific type of project (such as C# library), that is the reason why you could not add Item template to the solution.

When you add a new item to a solution using Visual Studio, you'll only see those items that are in General Category. All those files are not "templates", they can be find here :

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\NewFileItems

So, if you want to add New Item dialog for the solution, you could add your custom file, like, Test.py, then restart the Visual Studio to add the new item for solution:

enter image description here

Hope this helps.

Upvotes: 0

Related Questions