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

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.

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:
Hope this helps.

Related

Visual Studio TFS add-in branch context menu

How can I add a custom entry to the context menu of a branch in the Source Control Explorer of TFS?
To add context menu options you need to create an entry in a Visual Studio Command Table file. The simplest way to do this is to create a new extensibility project (you need to install the Visual Studio SDK first) - this has an example of how to add a custom command to an existing menu.
For more about vsix and vsct extensibility check:
https://msdn.microsoft.com/en-us/library/bb164699.aspx
I also found this blog useful:
http://dotneteers.net/blogs/divedeeper/archive/2008/04/17/LearnVSXNowPart18A.aspx

How to add the currently edited file to project

In Visual Studio 2013, often I am editing a file that is not in the current project, and would like to add this file to the project. Is there an easy way to do that? The only way I've found is via right click on the project, Add/Existing Item (Shift+Alt+A), and then browse to the file I want to add in the dialog. Is there a shortcut I am missing?
This works in Visual Studio 2010:
Right-click on the document tab, select "Copy Full Path".
Project - Add Existing Item - Ctrl+V - Add.

Create resource using Visual Studio 2010?

I'm attempting to create a resource in Visual Studio 2010 which I will use to create a custom dialog box. Microsoft gives these steps:
http://msdn.microsoft.com/en-us/library/sxdy04be.aspx
However there is no "Resource File" option in the Add New item dialog. There is, however, an "Add Resource..." menu item in the Project menu. However, this item is dimmed out. Why is it dimmed out? How can I get it to be available?

How add an item template to Visual Studio 2010

Let me elaborate, since the title was a little rough. I have been looking for a way to make a WCF service work with Silverlight for days now. Eventually I come across a mention of something called a 'Silverlight-enabled WCF service'. The only problem is, this doesn't exist in my Visual Studio 2010 (and I have looked).
Someone then asked me whether it appears in Program Files(x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Silverlight\1033. Well it looks to be - there is a file called SLWcfService.zip.
Assuming this is the template I'm looking for, how do I get Visual Studio to add this to the list of item templates that I get when I select a new project?
Thanks.
I don’t about your specific case, but if you have an item up on VS and you want to save it as a template: Click on: File -> Export Template -> and then select Item Template.

Where does Visual Studio store file properties?

In Visual Studio there are some file properties such as Build Action, Custom Tool, and whether the file is Content etc. Where are these properties stored? For instance, if I modify the build action for a file, how does Visual Studio remember the new value?
In the .CSPROJ file, wich is stored as xml since Visual Studio 2005 I think. You can Right Click on a project, do "Unload", and then right click again and do "Edit xxx.csproj" and you will see the text directly. If you update it, you can again right click and do a "Reload".
You'll want to take a look at the solution (.sln) and project (.csproj) files.
This msdn project properties link might also help.

Resources