Question

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">
    <system.web>
      <httpRuntime executionTimeout="7200" />
    </system.web>
  </location>

I set it to 2 hours to be sure :)

Was it helpful?

Solution

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" />
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top