Pages

31 March 2010

Server Error in '/' Application :: Parser error

Are you getting this error message after solution deployment :

Server Error in '/' Application.
Parser Error
Description: 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: The base type 'System.Web.UI.MasterPage' is not allowed for this page. The type is not registered as safe.


Source Error: 
Line 1: <%@ Page Inherits="Microsoft.SharePoint.Publishing.TemplateRedirectionPage,Microsoft.SharePoint.Publishing,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %> <%@ Reference VirtualPath="~masterurl/custom.master" %>

<German>
Oder auf Deutsch:

Serverfehler in der Anwendung /.
--------------------------------------------------------------------------------
Parserfehler
Beschreibung: Fehler beim Verarbeiten einer Resource, die für diese Anforderung erforderlich ist. Überprüfen Sie folgende Fehlerinformationen und ändern Sie die Quelldatei entsprechend.

Parserfehlermeldung: Bei der Verarbeitung der Seite ist ein schwerwiegender Fehler aufgetreten. Bitte wenden Sie sich an den Administrator dieser Website, um Hilfe zur Behebung des Problems zu erhalten.

Quellfehler:

Zeile 1:  <%@ Page Inherits="Microsoft.SharePoint.Publishing.TemplateRedirectionPage,Microsoft.SharePoint.Publishing,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %> <%@ Reference VirtualPath="~TemplatePageUrl" %> <%@ Reference VirtualPath="~masterurl/custom.master" %>

</German>

Well, don't despair, there is HOPE!
Check your web.config for faulty entries - usually safecontrols area
If that's OK, then check the references that your solution needs - if the ones that are expected to be in GAC are actually in GAC and if the paths for referenced DLLs are in the expected folders.

Be sure that you are NOT deploying a solution which includes a reference to Microsoft.SharePoint.ApplicationPages.Administration.dll on publishing sites. You get the error above.

Anyway - this is another proof - if anyone needs an extra one - that error/exception handling in MOSS 2007 needs improvement.

Is the 14th version of MS Office Server better in this respect?
Is MOSS 2010 more clear in the error/exception messages that it throws?