This project is read-only.

Error when clicking a menu item


This error popups whenever I click on my menu item, or any of the built-in ones (e.g., Managed menu Extensions -> How to..)

file attachments


Jern wrote Sep 4, 2010 at 9:54 PM

Since you posted another bug 16 minutes before this one I kind of deduce from that bug that you have not had this problem all the time right ?
So do you know what you did that might have caused it ?

ulu wrote Sep 5, 2010 at 9:39 AM

No, it was the other way round.

First I tried my menu item with a dot, it threw an exception on load (the prev bug), next I removed the dots, it showed my menu item, but clicking it resulted in this error message.

Jern wrote Sep 6, 2010 at 9:50 PM

Ok, if you post your implementation of IMenuManager I might be able to reproduce the bug.

marcon wrote Sep 29, 2011 at 8:50 AM

I had exactly the same issue and ended up debugging the code. I found out the Tag property is not populated in the menuItemHandler_Click event. After I changed it all to use the InstanceId property and changing the dictionaries to use type int as key I managed to get it working again. Not sure if the InstanceID is unique but it seems to do the trick for me.

marcon wrote Sep 29, 2011 at 8:53 AM

I had the same issue and had to debug the code to figure out what was happening. I found out the Tag property of the CommandBarControl variable in the menuItemHandler_Click event was not populated correctly for whatever reason. I changed it to use the InstanceId property instead and changed the key of the dictionaries to int. It seems to have fixed my issue although I'm not sure this is the correct way to solve it. The InstanceId might not be unique.

Jern wrote Sep 29, 2011 at 10:55 AM

Sounds weird. Would be nice if you could send your implementation of IMenuManager (as I also asked ulu a year ago :) ). You say Tag wasn't populated properly - was it null ? Or did it just have a value not in the dictionary. Did it contain a Guid ?

marcon wrote Sep 30, 2011 at 3:20 AM

This is happening without using any custom menus. This even happens when only the MMEHelper and MMETools are in the \ProgramData\MME directory. So this happens before I copy my custom assembly to the MME directory.

The tag value is empty as far as I can tell so not null. It does not have the GUID value of the tag as set when adding the menu options elsewhere in the code. Somehow the tag values are lost when the click event is fired. The instance ID however seems to work.

Jern wrote Oct 2, 2011 at 7:49 AM

So as I understand it you have the problem right after install of MME ? If that is the case I would of course be very interested in solving that but it gets kind of difficult since it must have something to do with your machines setup compared to mine.

wrote Feb 13, 2013 at 8:50 PM