Skip to main content

Cloud

Strange CustomAction behavior in WebApplication-scoped features

Yesterday, I posted about some interesting behavior related to CustomActionGroups. This post is related to a similar issue, but in a specific situation.

I was working on a project recently in which we created multiple custom timer jobs. These jobs had some user-configurable settings, so I decided to create an ASPX page to perform the configuration, and create a link to the page from the "Application Management" tab within Central Admin. Seems straightforward enough, right? I created a feature scoped to the WebApplication level, then installed it to the farm. The content of the elements.xml for the feature looks something like this:

   1: <?xml version="1.0" encoding="utf-8"?>
   2: <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   3:     <CustomActionGroup
   4:         Id="MyApp.TimerJobSettings"
   5:         Location="Microsoft.SharePoint.Administration.ApplicationManagement"
   6:         Sequence="100"
   7:         Title="MyApp Settings" />
   8:  
   9:     <CustomAction
  10:         Id="MyApp.TimerJobSettings.Configuration"
  11:         GroupId="MyApp.TimerJobSettings"
  12:         Location="Microsoft.SharePoint.Administration.ApplicationManagement"
  13:         Sequence="100"
  14:         Title="MyApp timer job settings">
  15:  
  16:         <UrlAction Url="~Site/_admin/MyApp/JobSettings.aspx" />
  17:     </CustomAction>
  18: </Elements>

The feature specifies a CustomActionGroup that will be displayed in the "Application Management" tab within Central Admin (see the "Location" attribute). Then, a CustomAction with a link to the ASPX form is placed within the custom group.

Once installed, the feature shows up fine in the "Manage Web Application Features" screen in Central Admin:

2008-09-30_224958

However, after activating the feature on one of my content web applications, the custom action group doesn’t display as expected in Central Admin — so there’s no link to the configuration ASPX page. What? In fact, the only way I’ve found to get the admin link to display is to activate the feature for the Central Admin web application. Once that’s done, the custom action group and custom action now appear as expected on the "Application Management" tab:

2008-09-30_225554

Of course, in doing that, I’ve now activated the feature on two web applications when in fact, I only really wanted it to run on one. So in this particular case, I’ve simply gone to the "Timer Job Definitions" page from the "Operations" tab and disabled the timer job on the Central Administration web application. While that seems like a hack, I haven’t found any other way to get the custom action to display in Central Admin.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Matthew Morse

More from this Author

Follow Us