It is almost a week that I am trying to figure out how to override ViewCode command. I have tried different things without any success.
What I have done is to add a UsedCommand element to UsedCommands in vsct file and added my command handler using IMenuCommandService.
<UsedCommands> <UsedCommand guid="guidVSStd97" id="cmdidViewCode" /> </UsedCommands>
var viewCodeCommand = new OleMenuCommand(viewCodeCommand_Run, StandardCommands.ViewCode); viewCodeCommand.BeforeQueryStatus += new EventHandler(viewCodeCommand_BeforeQueryStatus); mcs.AddCommand(viewCodeCommand);
This is exactly what has been suggested in lots of blogs and samples over the internet. What else is required?