Set Up – Web Config Changes For Customization

Alright, first post, but a rather necessary one. Every time I do a new SharePoint installation, I find myself constantly going straight to the web.config file to make a couple changes.  If you have spent any time with SharePoint you already know about these, but I find it’s always good for a reference.

I know that it’s not recommended, but I find creating an entry in the PageParserPath block to be invaluable for testing out some code against the API in a quick and dirty fashion. It beats having to pack up and deploy features every time I want to test a line of code.

1. First create a folder in your “Pages” directory (once you’ve turned publishing on)

2. Then, to add runnable ASP pages with custom code, modify the PageParserPaths block of the web config:

<PageParserPaths>
<PageParserPath VirtualPath=”/pages/asp/*” CompilationMode=”Always” AllowServerSideScript=”true” IncludeSubFolders=”true” />
</PageParserPaths>

The other thing I do right out of the gates is to change the error reporting over, so that I start getting valuable info, instead of the canned SharePoint error screens, which are seldomly informative.

<SafeMode MaxControls=“200“ CallStack=“false“…

to…

<SafeMode MaxControls=“200“ CallStack=“true“…

Also:

<customErrors mode=“On“/>

to….

<customErrors mode=“Off“/>

Posted in SharePoint 2007, SharePoint 2010.

Leave a Reply

Your email address will not be published. Required fields are marked *