[MenuItem()}] giving error

// Add a menu item named “Do Something” to MyMenu in the menu bar.
[MenuItem(“MyMenu/Do Something”)]
static void DoSomething()
{
Debug.Log(“Doing Something…”);
}
Severity Code Description Project File Line Suppression State
Error CS0592 Attribute ‘MenuItem’ is not valid on this declaration type. It is only valid on ‘method’ declarations. Assembly-CSharp-Editor C:\Users\phyzx\Documents\UnityProjects\Spheraze\Assets\Spheraze\Editor\RadicalGraticle.cs 6 Active

But this is the format mentioned in the doco.

Or did it really morph into this monstrosity:

That’s not the MenuItem.

That’s your linker. It’s a linker error. You probably got something wrong linking your DLLs.

What is “monstrous” in that? Besides if you watch carefully, they also use the MenuItem attribute in there with the same syntax.

Fix your linking and it should work. Make sure you don’t link editor from your run-time code. I wish I could help more, but I really don’t build separate DLLs, I hate those. I rather ship my source code with my work so in case anything happens, users can hot-fix the stuff they buy into. And you would have easier time to do these things too. (Using assembly definition files, obviously, so Unity itself compile your code into separate DLLs)