Create .NET Core Template
How to create .NET Core Template and make it installable VSIX in visual studio 2019
Create a Project Template
Step 1: Configuring the Project Template with code
First we need to create a project in Visual studio based on the need like settings configurations, packages and more. Below we have an example of the project which is configured with APM based Micro service.

using Standard.TraceLog;
using System;
namespace APM.Sample
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello APM!");
TraceLogSetup();
for (int logCount = 0; logCount <= 10; logCount++)
{
Logger.Log.Information("My APM Sample");
Console.WriteLine(logCount);
}
Console.WriteLine("All Set..");
Console.ReadLine();
}
public static void TraceLogSetup()
{
//TODO: Trace Log: Please change the configuration based on the project selection
Logger.AccessKey = "accesskey";
Logger.SecretKey = "secretkey";
Logger.Exchange = "APMFrameworkTest_Exchange";
Logger.ExchangeType = "direct";
Logger.SSLEnabled = false;
Logger.PortNumber = 5672;
Logger.RouteKey = "APMFrameworkTest_Trace";
Logger.HostName = "10.187.139.233";
Logger.ProjectName = "XXXXX";
Logger.ExpireInDays = 30;
Logger.Setup(AppenderType.APM);
}
}
}
Step 2: Export as "Project Template"
Now from the visual studio under project menu, select "Export Template" menu.

A wizard will open on that select "Project Template"

Now click on "Next"

Provide the project details and click on "Finish", now we will get the project template as the Zip File.
Creating VSIX File
Step 1: Create a new Project of project type "Extension", VSIX Project


In some case "Empty VSIX" is working due to Extension problem.
Step 1: Select the .vsixmanifest file
Double click on the Manifest file and provide the project details as we wish.

Step 2: Supported Visual Studio

Step 3: Asset Selection
Under asset section click on the new button and select
"Microsoft.VisualStudio.ProjectTemplate
" and select the zip file which we created during "Project Template creation"


Now build the solution, our VSIX template would be ready for installation.
After installing the VSIX File, we could find the template in our visual studio 2019, as shown below

How to Uninstall the existing VSIX package ?
The simple step to uninstall
Go the Visual Studio 2019 Menu, Select "Extension" under that select "Manage Extensions".
Select "Installed" Category, under that find the product and uninstall.
It will be uninstalled during next restart of Visual Studio 2019.


Last updated
Was this helpful?