www.example.com/Pages/Default.aspx gives me a 404 on Sharepoint….How to use logging to find the error.

I was trying to bring up a new Sharepoint site, when I tried to browse the site (www.example.com/Pages/Default.aspx ),   Sharepoint gave me a generic ‘file not found’ error.   The message wasn’t real helpful.   

Step 1 – I set the two values in the web.config to True.  (PS-This is a test / sandbox machine)

‘This is in the web.config located
    <SafeMode MaxControls=”200″ CallStack=”True” DirectFileDependencies=”10″ TotalFileDependencies=”50″ AllowPageLevelTrace=”True“>

When I browsed the site locally after making the web.config changes.  I got a 404 error.  The IIS logs showed a 404. 

Step 2 – When I cranked up the Sharepoint logging, I found this error in the logs.  The bolded part showed a ASCX file not found.  I copied from another server and was able to browse the site.  ?

w3wp.exe (0x0E80)                        0x0F9C Windows SharePoint Services    General                        8nca Verbose  Application error when access /Pages/default.aspx, Error=The file /_controltemplates/PublishingActionMenu.ascx does not exist.   at Microsoft.SharePoint.ApplicationRuntime.SPRequestModuleData.GetWebPartPageData(HttpContext context, String path, Boolean throwIfFileNotFound)     at Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.CalculateFileDependencies(HttpContext context, SPRequestModuleData basicRequestData, ICollection& directDependencies, ICollection& childDependencies)     at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureDependencies(HttpContext context, SPRequestModuleData requestData)     at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.GetDirectDependencies(HttpContext context, SPRequestModuleData requestData)     at Microsoft.SharePoint.ApplicationRun… 

Here is the procedure I followed to enable Diagnostic logging.

Hope this helps,

Steve Schofield
Microsoft MVP – IIS