Build a UI in Visual Studio for Dotnet New Templates
See original GitHub issueVS is where all the users are at for consuming templates. I’m having huge problems getting my current VSIX template working with VS 2017. Every VS upgrade breaks something which is hugely frustrating. I’d like to be in the template authoring business, not the VSIX authoring business.
Visual Studio Template VSIX
It would be great if there was an easier way to build a project template VSIX (or some other mechanism) around my template NuGet package with a feature selection UI built around template.json. That way template authors could easily release their templates to their biggest market. Whatever the mechanism for getting my template into VS, I’d like it to appear in the Visual Studio Gallery.
Icons, Logos & Banner Images
It would be great to include icons for the template and any symbols in the template. I propose extending the template.json file to add these. I’ve shown the values as URL’s but they could equally be file paths relative to the .template.config folder:
{
"name": "ASP.NET Core 1.1.1 MVC 6 Boilerplate API",
...
"logo": "http://example.com/logo.png",
"banner": "http://example.com/banner.png",
"symbols": {
"Swagger": {
...
"icon": "http://example.com/swagger/icon.png"
},
"PrimaryWebServer": {
...
"icon": "http://example.com/primarywebserver/icon.png"
"choices": [
{
"choice": "Kestrel",
"icon": "http://example.com/primarywebserver/kestrel/icon.png"
},
{
"choice": "WebListener",
"icon": "http://example.com/primarywebserver/weblistener/icon.png"
}
]
}
}
}
Cross Platform Feature Selection UI
Another idea is to make the feature selection UI cross-platform so a potential extension could also be created for Visual Studio Code. A simple ASP.NET Core UI could be fired up as that’s already cross platform. Once features have been selected and you hit ok, you shutdown the ASP.NET Core site and work the templating engine magic.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:17
- Comments:70 (29 by maintainers)
Top GitHub Comments
Hi everyone, I wanted to let you know that my team is working to automatically display templates in Visual Studio that were installed with
dotnet new —install
. We are still ironing out the details, but it is in progress.Hi @RehanSaeed thanks for the issue. This is something that we are very much interested in. We’ve already started working on it actually.
For the cli we are planning to implement
--install
,--uninstall
, and--update
for the cli indotnet new
.For Visual Studio we are planning to create a new entry in the New Project Dialog which will launch a WPF dialog that allows you to:
This WPF dialog would also handle prompting for the parameters that the template makes available.
With this model when you ship your template for
dotnet new
, it will be available also to Visual Studio. You wouldn’t need to worry about any Visual Studio specific work (unless you wanted to customize that experience).If you’re specifically looking to create a new entry in the New Project Dialog, I think the best thing to do there is to create a new VSIX containing your .vstemplate which has a custom wizard to invoke the Template Engine. The code for our WPF dialog will be open source so you should be able to create such a wizard for your own specific scenarios. I can help you with this as well when the time is right.
With respect to the cross platform UI idea. I think its an interesting idea but, if we implemented that I think we will have one UI used across various different scenarios. This isn’t the desired result. In Visual Studio when creating a project I want to go through the familiar UIs that I’m used to. It would be strange for VS to launch a UI that looked different. Also the same can be said about VS4Mac and other IDEs/Editors that are integrated with the Template Engine. The specific UI/UX needs to be implemented in a first class way for that specific scenario. So having a shared UI is not that useful.