Tuesday, May 29, 2007

Web Configuration Namespace

If you've opened a sharepoint virtual directory as a file system web site using Visual Studio, watch out for the following gotcha (also discussed here):

If VS updates the web.config file, it will add the a reference to the xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" namespace in the root configuration element.

This will lead to various "File not found" error messages with the log file showing entries like the following:

Could not load file or assembly 'Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'

Remove the namespace reference and the problem goes away.