I have custom action defined in my SharePoint 2007 feature. It adds new item to document library menu.

<CustomAction Id="UserInterfaceLightUp.MobiusDiscretionaryArchivingLibMenu"
Sequence="1002" ImageUrl = "/_layouts/IMAGES/MyImage.gif" Title="My Title"/>

When I deploy it to SP 2010 I get the same behavior for 2007 UI mode and these actions becomes available from "Custom Commands" in 2010 UI mode. Is there any way to not allow menu appear in "Custom Commands". For this I would like to create ribbon buttons for 2010 UI mode only and menus for 2007 UI mode only.

Thanks beforehand.

2 Answers 2


Same answer as on SO

Have a look at our series about porting a SharePoint 2007 solution to 2010 while maintaining compatibility with both.

In summary, to solve your problem we maintain a separate SPHive_2010 folder that contains files that will be used to overwrite the SP2007 specific ones during the build process. We build 2 separate WSP files.


Answer from msdn forum:


Thanks for help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.