Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have added 1 Element File for CustomRibbon Button.

And added 1 Feature to deploy this RibbonButton.

When I deploy this, it deploys and Feature is Activated but not displaying the Button in ListRibbon. I don't know what is the problem ?

But when I write ElementFile Location="Ribbon.xml in ElementManifests tag of Feature it gives me an error while deploying.

Error occurred in deployment step 'Add Solution': Error: Cannot find this file specified in the manifest file:MyProject_MyRibbon\Ribbon.xml

My Element.xml file is as under:

<CustomAction
  Id="{E538E8C7-65DA-454E-AD87-4A603B6CC679}"
  RegistrationId="100"
  RegistrationType="List"
  Location="CommandUI.Ribbon"
  Sequence="5"
  Title="My Custom-Ribbon" >

    <CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/">
        <CommandUIDefinitions>
            <CommandUIDefinition Location="Ribbon.List.Settings.Controls._children">
                <Button
                    Id="{C3842C6A-B15D-44EF-94A4-2137E74A8701}"
                    Alt="My Custom Ribbon"
                    Sequence="5"
                    Command="{A9AF0088-FE1C-4EA2-9E94-FDF02E101D4C}"
                    Image32by32="_layouts/Images/Test/ABC.jpg"
                    Image16by16="_layouts/Images/Test/ABC.jpg"
                    LabelText="My CustomRibbon"
                    TemplateAlias="o1" />
            </CommandUIDefinition>
        </CommandUIDefinitions>

        <CommandUIHandlers>
            <CommandUIHandler
              Command="{A9AF0088-FE1C-4EA2-9E94-FDF02E101D4C}"
              CommandAction="javascript:alert('SharePoint 2010 Rocks!');" />
        </CommandUIHandlers>

    </CommandUIExtension>
</CustomAction>

share|improve this question
    
Shahid, please share your Elements.xml file –  Arsalan Adam Khatri Dec 1 '12 at 12:05
    
Hi Arsalan, I have added element.xml file in the question. –  Shahid Dec 3 '12 at 4:52
    
Its working in my CustomList which is created from Site. But not working when List is created from visual studio code. –  Shahid Dec 3 '12 at 6:37
    
Then problem not seems to be in CustomAction.. Can you post the code how you creating the List via code? –  Arsalan Adam Khatri Dec 3 '12 at 6:39
add comment

1 Answer 1

Shahid

Open the feature that includes the project item and expand the files node on the project item to verify the files that are included with the item. I suspect that your elements file will not be displayed. You need open the properties for the elements file (open the file and click F4), and make sure that the type on the file is set to "ElementManifest". Also, Change .WSP to .Cab and look inside" because it would be very helpful!

share|improve this answer
    
Thanks Falak Mahmood. –  Shahid Dec 5 '12 at 7:26
    
did it help? Please share you experience? –  Falak Mahmood Dec 5 '12 at 8:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.