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.