ReSharper 2025.3 Help

Code inspection: The same shortcut is defined for another menu item

This inspection reports duplicate shortcut definitions in MenuItem attributes. If more than one menu item uses the same shortcut, Unity can behave unpredictably, and the shortcut may trigger the wrong command or be ambiguous.

Example

In this example, both RunAction and RunOtherAction use the same shortcut %g.

using UnityEditor; public class Example { [MenuItem("Tools/Run Action %g")] static void RunAction() { } [MenuItem("Tools/Run Other Action %g")] static void RunOtherAction() { } }
using UnityEditor; public class Example { [MenuItem("Tools/Run Action %g")] static void RunAction() { } [MenuItem("Tools/Run Other Action %h")] static void RunOtherAction() { } }

Quick-fix

This inspection does not provide a dedicated quick-fix. Fix the conflict manually by changing or removing one of the shortcut definitions.

26 March 2026