Typical Web.config Tweaks

These are some web.config modifications that I typically need at my fingertips.  After all, who can memorize all this stuff?

Allow scripts to be embedded in asp pages.

      <PageParserPaths>
        <PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />
      </PageParserPaths>

Allow asp scripts to access external libraries

In the following case, SharePoint Taxonomy libraries:

<add assembly="Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />

Create a reference to custom web service

Each method in the web service becomes a service “method”.

  <location path="_layouts/SPUtilities/SPservice.asmx">
    <system.web>
      <webServices>
        <protocols>
          <add name="HttpPost" />
        </protocols>
      </webServices>
    </system.web>
  </location>

Error reporting

Show a detailed error (rather than the generic sharepoint error).

Before:

<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">

After:

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="true">

Before:

<customErrors mode="On" />

After:

<customErrors mode="Off" />

Leave a Reply

Your email address will not be published.