Unrecognized attribute 'securityTrimmingEnabled'. Note that attribute names are case-sensitive

Date Published: 05 November 2008

Unrecognized attribute 'securityTrimmingEnabled'. Note that attribute names are case-sensitive

Saw this error today working with the SiteMapDataSource in ASP.NET 3.5/VS2008. Apparently this is a bug that has been around for a while, and is discussed here and logged in Connect here.

The issue, however, is that the securityTrimmingEnabled attribute pops up in Intellisense in VS2008 when editing the web.sitemap file. However, using it results in the error:

Unrecognized attribute ‘securityTrimmingEnabled’. Note that attribute names are case-sensitive.

The bug is in the VS Intellisense – it should not be showing an attribute that is not a viable option. This property is actually set on the provider and configured in web.config. The forum link above has the solution, which I’m reproducing here:

<siteMap defaultProvider=”XmlSiteMapProvider” enabled=”true” >\
<providers>\
<clear />\
<add name=”XmlSiteMapProvider”\
description=”Default SiteMap provider.”\
type=”System.Web.XmlSiteMapProvider”\
siteMapFile=”Web.sitemap”\
securityTrimmingEnabled=”true” />\
</providers>\
</siteMap>
Steve Smith

About Ardalis

Software Architect

Steve is an experienced software architect and trainer, focusing on code quality and Domain-Driven Design with .NET.