Custom errors in custom Central Admin pages

I have been developing using SharePoint for several years but the other day I needed to create a new page to be displayed in Central Administration. Since I had already installed CKSDev on my development environment I was able to use the ‘Central Administration Page’ template which creates the aspx page and the custom actions for a custom group and link.

I used this as a starting point and set about modifying it to meet my requirements. As with all projects/code I started to encounter some errors but I was unable to see the actual error detail. Instead I just got the standard error screen, see figure 1, telling me to configure the settings in the web.config.

Figure 1

StandardErrorScreen

I think most developers have seen this message a thousand times or more so I knew I had to set the CallStack attribute of the SafeMode element under the SharePoint element to true. In addition I set the mode attribute of the customErrors element to Off. As I mentioned most developers have done this several times so this in its self wasn’t new but what I found was even with these settings I still received the standard error screen, figure 1.

My first thought was I must have either set the wrong web.config or the settings were wrong but after checking and rechecking everything was correct. At this point I turned to Google and I found a few generic articles on setting the customErrors and CallStack but this wasn’t what I was interested in.

Eventually I found an article Custom errors in web.config and SharePoint 2010 which had a little section at the bottom which explains that if you put pages in certain locations then you also need to update additional web.configs. In my case I had deployed my page to the admin folder under 14/template. Once I updated the web.config here the full error details started to display and I could work out the actual issue.

Just go to show no matter how long you are doing something you can always learn Smile

Advertisements

One Response to Custom errors in custom Central Admin pages

  1. It difficult to find a solution for me, now it fixed great thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: