3

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>

4
  • Shahid, please share your Elements.xml file Dec 1, 2012 at 12:05
  • Hi Arsalan, I have added element.xml file in the question.
    – Shahid
    Dec 3, 2012 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, 2012 at 6:37
  • Then problem not seems to be in CustomAction.. Can you post the code how you creating the List via code? Dec 3, 2012 at 6:39

2 Answers 2

1

https://books.google.co.in/books?id=q_L_jQ4VYpsC&pg=PT300&lpg=PT300&dq=create+features+elements+file,&source=bl&ots=2T5lGxMUfh&sig=D5G3Zp-_6rvt7Gs-XZHCoCjGMYQ&hl=en&sa=X&ved=0CEMQ6AEwBWoVChMIheak4vSbyAIVjFuOCh1RyASL#v=onepage&q=create%20features%20elements%20file%2C&f=false

This may help. Gives an overview from 14/ folder and from solution.

2
  • 1
    Quote some of the most important bits of the solution. Sep 29, 2015 at 12:55
  • Link only answers are not that helpful. There are high chance that link will break. Please provide information which is useful to other visitors.
    – Asad Refai
    Sep 29, 2015 at 13:14
0

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!

1
  • did it help? Please share you experience? Dec 5, 2012 at 8:58

Your Answer

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

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