Is it possible that feature activation will fail or will end unexpectedly (without any exceptions in ULS) when it takes too long for code to finish the job?

We have a feature which during activation is performing some analytic work on already existing list items and it runs quite long time (more than 30 minutes). I also tried to limit number of items while investigation and than feature worked perfectly. It seems like something (.net or IIS, maybe SharePoint itself) is terminating thread where code is running after some time but that's just my guess...

UPDATE Editing web.config file in 14 hive LAYOUTS directory is one way how to solve this. If you don't want to use powershell, you can also add this into inetpub web.config file among other location tags:

<location path="_layouts/ManageFeatures.aspx">
      <httpRuntime executionTimeout="7200" />

I set it to 2 hours to be sure :)

  • How are you activating the feature? Sharepoint manage features page, visual studio or powershell? – Aanchal Jun 23 '14 at 8:53
  • Yes, using the ManageFeatures.aspx page – Diomos Jun 23 '14 at 9:23

The problem is that activating a feature via the "ManageFeatures.aspx" page means that the request to activate the feature is handled by asp.net and as such is subject to the same rules that govern any asp.net request, including maximum execution time out.This timeout value can be changed by modifying the "web.config" at the root of the layouts directory. The actual value you need to change is the attribute called "executionTimeout" within the "httpRuntime" element. An example is shown below were the execution timeout has been changed to ten minutes.

<httpRuntime executionTimeout="600" />
  • Thanks a lot for reply! Yes, this sounds like the source of the issue. So maybe moving to powershell will help too? I'll try out and let you know – Diomos Jun 23 '14 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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