如何移除Visual Studio失效菜单?解决VS2017右键COM错误菜单问题
Hey there, let's get rid of that annoying dead menu item throwing COM errors in VS2017. I've worked through similar stale command issues before, so here are three reliable methods to clean it up—start with the safest first:
Method 1: Use VS's Built-in Customization Tool (Most Recommended)
This is the least risky way since it uses Visual Studio's native tools:
- Open Visual Studio 2017, head to the top menu bar and click
Tools→Customize - In the pop-up window, switch to the
Commandstab - Select
Context menufrom the dropdown at the top, then findEditor Context Menus | Code Windowin the list below (this maps to yourEditorContextMenus.CodeWindowtarget) - Scan the right-side command list for the broken
Locate in Solution Explorerentry - Select it, click the
Removebutton, then hitCloseto save changes - Restart Visual Studio, and that dead menu should be gone for good
Method 2: Reset Visual Studio Settings (If Customization Fails)
If the first method doesn't work, resetting settings can wipe out stale command references—just make sure to back up your custom settings first:
- Go to
Tools→Import and Export Settings - Choose
Export selected environment settings, pick the settings you want to keep, and save them to a file for backup - Open the same
Import and Export Settingswizard again, selectReset all settings, and follow the prompts to reset to default - Restart VS, and the broken menu should disappear. You can then re-import your backed-up settings if needed.
Method 3: Edit the Registry (Advanced Users Only)
Only try this if the above methods don't work—always back up your registry before making changes:
- Press
Win + R, typeregedit, and hit Enter to open the Registry Editor - Navigate to this path:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0\ContextMenuCommands(note: 15.0 is the version code for VS2017) - Look for a key associated with
EditorContextMenus.CodeWindow.LocateinSolutionExplorer - Right-click the key and select
Delete, then close the Registry Editor - Restart Visual Studio, and the problematic menu should be removed
Quick Notes
- Always restart VS after making any changes to ensure they take effect
- If you're unsure about registry edits, stick to the first two methods—they're far safer for most users
内容的提问来源于stack exchange,提问作者PAS
相关产品推荐
相关产品推荐

