Change category name for VSPS
Asked Answered
C

1

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"

Carafe answered 27/8, 2016 at 18:20 Comment(5)
What happens if you run the wizard again with the Project Type template and use "Visual Basic 6" as your namespace instead of VB6?Defrayal
As I said, I can't put spaces in the namespace.Carafe
Unfortunately I think that's your answer then, you can't put spaces in it.Defrayal
That is the point of my question. I want to change the category name. I mean, if VS can have "Visual Basic", "Visual C#", etc., then it should be possible for me to do the same. I saw other projects using the old MPF/MEF project system use category names with spaces in them.Carafe
Have you tried Visual&nbsp;Basic&nbsp;6?Tigges
T
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.

Tigges answered 8/9, 2016 at 12:59 Comment(8)
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#".Carafe
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.Tigges
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.Carafe
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.Tigges
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: github.com/tunnelvisionlabs/JavaForVS/blob/…Tigges
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.Carafe
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. github.com/tunnelvisionlabs/JavaForVS/blob/…Tigges
Let us continue this discussion in chat.Carafe

© 2022 - 2024 — McMap. All rights reserved.