private void BeforeQueryStatus(object sender, EventArgs e) { var menuCommand = sender as OleMenuCommand; if (menuCommand == null) { return; } CommandsUtil.ShowAndEnableCommand(menuCommand, false); var proj = VisualStudioAutomationHelper.GetActiveProject(_dte); if (!VisualStudioAutomationHelper.IsANetCoreProject(proj) && (!CommandsUtil.IsWebApiCoreInstalled(proj) || IsWebApiExplorerInstalled())) { return; } if (VisualStudioAutomationHelper.IsANetCoreProject(proj) && (!CommandsUtil.IsAspNet5MvcInstalled(proj) || IsNetCoreApiExplorerInstalled())) { return; } CommandsUtil.ShowAndEnableCommand(menuCommand, true); }