I have run in to a problem, I need to install an extension in Visual Studio, from code.
For example:
static void OSWindows()
{
//Install here Extension
MqttClient client = new MqttClient("");
//client.Connect("1");
if (client.IsConnected)
{
Console.WriteLine("Is 64Bit OS? " + Environment.Is64BitOperatingSystem);
Console.WriteLine("Logical Processor Count: " + Environment.ProcessorCount);
Console.WriteLine("Version: " + Environment.Version);
Console.WriteLine("System Page size: " + Environment.SystemPageSize);
Console.WriteLine("Machine Name: " + Environment.MachineName);
Console.WriteLine("Username: " + Environment.UserName);
}
}
The app is running on .Net Core. When it starts it finds out if the OS is Linux or Windows, and if it's Windows it should install an extension.
How can I do this?
Visual Studio provides a VSIXInstaller.exe utility (see how to locate it in https://github.com/microsoft/vs-setup-samples).
Then see how to install an extension with that utility and its command-line switch for the SKU (VS edition: Professional, Community, etc.) in my post: Using VSIXInstaller.exe to install programmatically an extension to Visual Studio 2015 and Visual Studio 2017