Today I run into a strange problem.
I build a new version of a product and installed it – and it crashed my entire SharePoint:
The error reads:
Parser ErrorDescription: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: This page has encountered a critical error. Contact your system administrator if this problem persists.
Line 1: <%@ Page Inherits="Microsoft.SharePoint.Publishing.TemplateRedirectionPage,Microsoft.SharePoint.Publishing,Version=188.8.131.52,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %> <%@ Reference VirtualPath="~TemplatePageUrl" %> <%@ Reference VirtualPath="~masterurl/custom.master" %>
Line 2: <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head>
Line 3: <!--[if gte mso 9]><xml>
Source File: /Pages/Default.aspx Line: 1
Well, I started investigating this strange error message…
The weird thing was, all my SharePoint sites reported this error except for central administration – which worked just fine!
After a short research I noticed in SharePoint Log this strange message, that my web part DLL was throwing an exception that it could not load a referenced file: Microsoft.SharePoint.ApplicationPages.Administration
Well… this makes sense, since this file only exists in central administration app_bin folder.
Things started to come together. All I had done wrong was to use this dll in my code, since I had some code that was running in central admin (settings page)
Well, as soon as I removed it from my references everything started working again.
Now I have to find another way to create a settings page, since GlobalAdminPageBase base class (for central admin settings pages) is something I cannot use.
Either that or I will have to separate my settings page into another DLL (which I prefer not to do)
Well, if you get this error message – be sure to check SharePoint logs and make sure you are not using this dll!