Open InteXX opened 4 years ago
@InteXX The VSIX project requires the template package project to be build first. The warning should be OK, but you can update the SDK reference in the VSIX csproj to match what you have installed locally. I haven't updated the project for newer versions of Visual Studio since I created the repo. The warning shouldn't impact generation of the VSIX though.
Are you able to successfully build if you run the following?
msbuild.exe TemplateSample.sln /t:Restore;Build
@InteXX and apologies for not seeing this comment earlier, I must have missed the notification, as I didn't expect this repository to have much traffic.
I got it to build with that, thanks. With no warning yet, and I didn't have to use the command line.
There seems to be some sort of strange caching going on, though, as I replaced MyConsoleTemplate.ico
with my own icon to get one that's more easily recognizable during testing. Even after the replacement, the old version kept getting packaged into the .vsix
. I had to rename the file and its reference before it would update.
Tell me... what's the significance of the TemplatePackage
project? I see the generated .nupkg
is making it into the .vsix
, but it's not being installed anywhere—either at runtime or during an experimental instance.
I didn't expect this repository to have much traffic
Well, you've been found ;-)
Ed Dore is helping me on a ticket where we're trying to build a .vsix
to install a .NET Core project template in VS (I'm using 2019 Pro). This repo came to my attention through that ticket. Your sample makes some promising headway, so thank you. (I must concede that my expertise in this area is not significant.)
I was hoping that your TemplatePackage
project would turn out to provide functionality similar to what we see when we add a new Azure Functions project, where we encounter a secondary dialog asking us what sort of trigger we want to use. But this doesn't seem to be the case. Maybe you could elaborate a little bit.
My end goal with all of this is to build a community contribution that mimics the behavior of the stock Azure Functions template but creates projects in VB.NET instead. You can find my first attempts here and here. As you can see I haven't included a .vsix
yet, pending resolution on all of this.
Any ideas you might have toward this end will be very welcome :-)
I got it to build with that, thanks. With no warning yet, and I didn't have to use the command line.
There seems to be some sort of strange caching going on, though, as I replaced
MyConsoleTemplate.ico
with my own icon to get one that's more easily recognizable during testing. Even after the replacement, the old version kept getting packaged into the.vsix
. I had to rename the file and its reference before it would update.Tell me... what's the significance of the
TemplatePackage
project? I see the generated.nupkg
is making it into the.vsix
, but it's not being installed anywhere—either at runtime or during an experimental instance.
The template package project is the actual dotnet template engine based template. This package in addition to be being able to be included in VSIX and referenced in the vstemplate stub file, can also be installed on the command line for use in 'dotnet new' by running dotnet new --install
The nupkg should be being installed it in to the install folder for the extension, which should be in the user profile folder for the Visual Studio instance in which the vsix was installed.
I didn't expect this repository to have much traffic
Well, you've been found ;-)
Ed Dore is helping me on a ticket where we're trying to build a
.vsix
to install a .NET Core project template in VS (I'm using 2019 Pro). This repo came to my attention through that ticket. Your sample makes some promising headway, so thank you. (I must concede that my expertise in this area is not significant.)I was hoping that your
TemplatePackage
project would turn out to provide functionality similar to what we see when we add a new Azure Functions project, where we encounter a secondary dialog asking us what sort of trigger we want to use. But this doesn't seem to be the case. Maybe you could elaborate a little bit.My end goal with all of this is to build a community contribution that mimics the behavior of the stock Azure Functions template but creates projects in VB.NET instead. You can find my first attempts here and here. As you can see I haven't included a
.vsix
yet, pending resolution on all of this.Any ideas you might have toward this end will be very welcome :-)
Azure Functions dialog uses an entirely different mechanism for those templates. While they are based of the same template engine as the other .NET Core templates, the method of acquisition is a bit different. For Azure Functions, the template nupkgs are discovered and installed via an SDK feed which is curated by the Azure Functions team.
What is happening when you create an Azure Function project is that a vstemplate is invoked which causes the custom UI to be displayed. This custom UI is implemented as an IWizard extension which is referenced in the vstemplate file. This flow actual creates a project template and applies the selected item template on that created projected.
Unfortunately, I don't think the right extensibility points currently exist to enable the what you are trying to achieve.
However, we are currently working to improve the Visual Studio experience in this space, and the extensibility issues are being considered. We have been primarily focused on the broader extensibility around .NET Core templates in general, and are just in the early stages of applying some of this work to Azure Functions templates. As explained though, the Azure Functions templates extensibility does need to consider the curated feed.
The template package project is the actual dotnet template engine based template
OK, I'll have a look at that, thanks.
Unfortunately, I don't think the right extensibility points currently exist to enable the what you are trying to achieve.
Hm, that's disappointing news.
But couldn't we build our own IWizard with a similar look-and-feel that would enable the user to select which trigger he wants?
The VSIX project won't build:
I attempted a
dotnet pack
, but that failed as well:Can you assist?