Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Disable add-in from VSIX package

$
0
0

I trying to disable an add-in when my package is initialized

EnvDTE80.DTE2 dte2 = (EnvDTE80.DTE2)GetService(typeof(EnvDTE.DTE));
foreach (EnvDTE.AddIn addin in dte2.AddIns)
{
    if (addin.ProgID.Equals("MyAdddin.Connect"))
    {
        addin.Connected = false;
        break;
    }
}

That seems to correctly disable the add-in as if you have unchecked the "Available Add-ins" column in the add-in manager, but when VS restart the add-in is enabled, any ideas how to make this change persistent?

I have other issue with this approach my package uses auto-load 

[ProvideAutoLoad(UIContextGuids80.SolutionExists)]

So the add-in doesn't get disabled until a solution opens, is there a way to get my package loaded after VS start even without solution, I see there is UIContextGuids80.NoSolution but isn't activate when VS just starts without a solution/project loaded.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>