While happily writing code and enjoying a fresh Spring breeze through my office window today, I received an ominous email from a user at a client’s company. The email said the user was trying to edit the membership of a group in SharePoint when they saw this:
An error occurred during the compilation of the requested file, or one of its dependencies. Warning as Error: 'System.Web.UI.Page.GetPostBackEventReference(System.Web.UI.Control)' is obsolete. 'The recommended alternative is ClientScript.GetPostBackEventReference. http://go.microsoft.com/fwlink/?linkid=14202.'
This seemed very odd to me because the URL of the page was “/_layouts/people.aspx,” which is obviously an out-of-the-box page that’s supposed to work. Also, this error was only happening on one of the three zones we’d configured for this web application. The page loaded fine in the other two zones. I did some searching online but didn’t find anything useful other than one guy saying he’d restored the DLLs in the SharePoint ‘ISAPI’ folder from a backup and that fixed the problem for him.
In hopes of getting a better error, I enabled debugging in the web.config file for the zone where the user was seeing this, including setting “<compilation debug=’true’ />.” The next time I loaded the site the problem was gone. So it appears that causing ASP.NET to recompile the web app was sufficient to solve the problem. When I finished testing I turned debug mode off and everything still worked.