1
votes

I'm trying to deploy multiple web parts as part of the same feature. SharePoint itself seems to do this quite happily by specifying multiple File elements in a single Module element (see C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\SearchWebParts); in my case, only the first web part is added to the Web Parts gallery, albeit to the Miscellaneous group instead of the group specified in the Property element.

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="WebPartPopulation" Url="_catalogs/wp" Path="WebParts">
    <File Url="Test1.webpart" Type="GhostableInLibrary">
      <Property Name="Group" Value="MyGroup" />
    </File>
    <File Url="Test2.webpart" Type="GhostableInLibrary">
       <Property Name="Group" Value="Mygroup" />
    </File>
  </Module>
</Elements>

My .webpart files are located in the same directory as the elements file; I tried setting Path="" on the Elements element but nothing gets deployed then. Switching around the two File elements deploys Test2.webpart instead of Test1 and Test1.webpart is not added on feature activation. Adding a single File per Module does work but that means duplicating the Module elements.

I'm self-closing the Property elements but that's surely not a sin?? What am I doing wrong?

1

1 Answers

0
votes

The above would seem to be correct: after a reboot and a sleep, both web parts ended up in their proper groups when I came back to it the next day. It's surprising how often I find a reboot fixes up weird SharePoint things like this that even and iisreset won't touch. Maybe other services that should be reset/caching these things?