Andrew Connell

Mea Culpa: Don't use visible Features to deploy custom tasks

My time for a mea culpa … but hey, at least I’m coming clean! Been meaning to post this for quite a while…

A while back I blogged about how to create custom tasks in WSS v3 . In that post, and the subsequent article that provided more detail , I showed how you can use a WSS Feature to register the task upon activation… however I had a little oversight. The Feature was visible, meaning you could activate it from within the Site Settings ยป Site Collection Features page. Many tried to do this, but as you will see from the comments at the end of the article, ran into problems when they tried to activate the Feature. This is actually a good thing… because you shouldn’t be able to do this!

Why? When activated via the Web interface, the Feature is activated using the application pool identity, which doesn’t [and shouldn’t] have sufficient rights to the farm’s configuration DB where the specific stored procedure resides that is called when you register a job. So what was everyone’s fix? Grant it rights… ooo… that’s not good! What I should have done was make that feature non-visible and force you to be logged in with an account that has sufficient rights to the farm’s configuration DB when activating the Feature. A small oversight, but one that confused quite a few people.

The code in the post and article have since been updated for future hits.

Andrew Connell
Developer & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to delivering industry-leading on-demand video training to professional developers. He lives with his wife & two kids in Florida.