If you are trying to add an menu to SharePoint Online, make sure you chosee “Host Web” instead of “App Web”.
![](https://peter.quantr.hk/wp-content/uploads/2019/05/bug-2-600x475.jpg)
If you chose wrongly, there is no way to convert it back in Visual Studio. You have to manually edit MenuItemCustomAction1\SharePointProjectItem.spdata , see below. You have to change the line from the top one to the bottom one.
After you edited it, restart visual studio is a must
![](https://peter.quantr.hk/wp-content/uploads/2019/05/bug-1-600x448.jpg)