Geeks With Blogs

Michael Waites

Recently I was having trouble with the following code:

SPWebApplication webApp = site.WebApplication;
webApp.FormDigestSettings.Enabled = true;

site.WorkflowManager.StartWorkflow(GetListItem(web, docList.ContainingDocumentLibrary, docFile.UniqueId), foundWorkflow, foundWorkflow.AssociationData, true);

//Turn security validation back on.
webApp.FormDigestSettings.Enabled = false;

More to the point, I got the following exception on the line webApp.FormDigestSettings.Enabled = true;

[5/18/2009--4:05 PM] Exception caught: Access denied.
[5/18/2009--4:05 PM] Stack:    at Microsoft.SharePoint.Administration.SPFormDigestSettings.set_Enabled(Boolean value)
   at GlobalDocumentCenter.GDC_Document.<>c__DisplayClass1.<ctrSubmitBtn_Click>b__0()

This code previously worked on this box about 2 months ago.

I first sent out an email to some buddies looking for help.

I did some searches and verified a few tidbits:
1. The app pool identity is in the Farm Admins.
2. The app pool identity is in the admin group on the box.

A friend of mine, as well, a fellow blogger (see side bar for Jason's blog) suggested "Restart the App Pool". We ignored him. He is a bit of a clown around the office, and is only a graphic artist.

However, a little bit after his email, and not getting anywhere, I asked for the app pool to be restarted. Low and behold, my problem went away.

The moral of the story... While most programmers want to think we live in a perfect world where frameworks and operating system code doesn't become corrupt somehow, it does. Always remember the simple stuff, often times it works. Restart the app pool. Restart the box. The scary part is more times than it should, it fixes the problem. As well, I would rather spend 5 minutes restarting and find out that didn't fix the problem, rather than spend hours and days or weeks on something that we just can't fix, and finally we realize a five minute restart would have fixed the issue.

May the schwartz be with you.


 

Posted on Tuesday, May 19, 2009 9:01 AM | Back to top


Comments on this post: Restart The AppPool

# re: Restart The AppPool
Requesting Gravatar...
Hi!
Did it really fix your problem? I would like to be sure it did because i m experiencing the same issue. And when i restart IIS, it works fine... a few hours later, the issue comes back.

Thanks
Left by Harimanana on Sep 28, 2009 4:57 AM

# re: Restart The AppPool
Requesting Gravatar...
Yes, in this case, it did solve the issue. However, if you then find that the issue is returning as soon as a few hours later, than something more problematic is occurring with your app pool.
Left by Michael Waites on Oct 28, 2009 6:30 AM

# re: Restart The AppPool
Requesting Gravatar...
I am having the same problem. I do an IISReset, everything works fine, and in the next day the problem occurs again.

Has anyone solved this?
Left by SFreire on Aug 06, 2010 1:04 PM

Your comment:
 (will show your gravatar)


Copyright © mwaites | Powered by: GeeksWithBlogs.net