10

I'm currently using the new Visual Studio Project System Extensibility library to implement a new project type for VS2015. What I would like to do is change the name of the "category" of that type of project. I would like it to be "Visual Basic 6". The problem is that when I create a package using the "Project Type" template, it asks me for a display name (which I set to "Visual Basic 6") and a namespace name (which I set to VB6), buth when I launch the VS experimental hive (with the default template code), the project template name is "Visual Basic 6 Project" but the category at the left is "VB6". I tried changing the line of the .vstemplate file from

<ProjectType>VB6</ProjectType>

to

<ProjectType>Visual Basic 6</ProjectType>

but if I do that, then the template simply doesn't appear in the New Project window. I also tried changing the value of the Language and UniqueCapability constants in the MyUnconfiguredProject.cs file, but it doesn't change anything. If I ever change the ProjectType value, the template disappears. I noticed that the category name is in fact the namespace name (and not the "Display name", why?), so it works if I put VisualBasic6, but I can't put spaces. How could I make the category be "Visual Basic 6"

zdimension
  • 977
  • 1
  • 12
  • 33

1 Answers1

0

I have tried to follow the tutorial here

If you create a new folder with spaces in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplates\VisualBasic\, put your templates in there, after running the devenv /installvstemplates command the templates indeed appear in a category with the given name including spaces.

This article also mentions, that you cannot create new category at the top level, only as sub-category of an existing language:

You cannot create a new category at the programming language level. New categories can only be created within each language.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
  • That is, again, the point of my question. I am not creating templates for an existing language. I created the project system and the language service, and now I want it to appear as "Visual Basic 6" in the New Project/Item window. For example, here, the folder is "VisualBasic", but it appears as "Visual Basic" (notice the space) in Visual Studio. The same way CSharp appears as "Visual C#". – zdimension Sep 08 '16 at 17:39
  • Then it seems you will need to create a Visual Studio extension, which will somehow add the new language category. I know Syncfusion and Telerik extensions are able to hook into the dialog somehow, but even though I have looked for that earlier today, I was unable to find anything :-( . Hope you will find a solution. – Martin Zikmund Sep 08 '16 at 17:42
  • As I said, I'm using VSPS to create a new project type, so I am using the provided "Project Type" template which creates a VSPackage project. Currently, everything works perfectly fine (I can create new projects, syntax highlight the source code files and even have a custom designer for .frm files), but I simply would like to change the display name. – zdimension Sep 08 '16 at 17:45
  • From what I have found, VSPS will apparently not be enough to accomplish what you need (which seems to be confirmed by the quote above. – Martin Zikmund Sep 08 '16 at 17:50
  • I have found a Java extension for Visual Studio which does this - it adds a new ProjectType - Java and also somehow registers itself into Visual Studio using a class like this: https://github.com/tunnelvisionlabs/JavaForVS/blob/18d689325d6ddba911da642dfec813a18e721b97/Tvl.VisualStudio.Language.Java/Project/JavaProjectNode.cs – Martin Zikmund Sep 08 '16 at 17:57
  • Yes... but... I mean... there're no spaces in 'Java'. If you can find (I wasn't able to) something that uses VSPS and that has spaces in its name, it would help me a lot. – zdimension Sep 08 '16 at 17:59
  • Here it registers Java into the Visual Studio environment using a LanguageInfo implementation. The LanguageName property is the one you need - there you can provide the name even including the spaces. https://github.com/tunnelvisionlabs/JavaForVS/blob/18d689325d6ddba911da642dfec813a18e721b97/Tvl.VisualStudio.Language.Java/JavaLanguageInfo.cs – Martin Zikmund Sep 08 '16 at 18:00
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/122924/discussion-between-zdimension-and-mzetko). – zdimension Sep 08 '16 at 18:03