The EnvDTE.Commands.AddNamedCommand method does not honor ContextUIGUIDs and vsCommandDisabledFlagsValue. In fact, it does it in the reverse way. First, see the MSDN docs:http://msdn2.microsoft.com/en-us/library/envdte.commands.addnamedcommand(VS.80).aspxAs the documentation states, if the add-in is not loaded, the ContextUIGUIDs and vsCommandDisabledFlagsValue parameters are used to know the state of the command (once loaded, the QueryStatus method will be used instead). If a ContextUIGUIDs is used and it is active, then the command should be enabled. If it is not active, then the command could be disabled or invisible and the programmer can specify it using the vsCommandDisabledFlagsValue. We will see that the AddNamedCommand does not behave as documented.
Version