I am using MvcSiteMapNode without xml just with the decorator's way. As i said in this post
I am sure that i have only one node with empty root node. Also it always works, except some times that i get this error.
There is more than one node declared without a parent key. The parent key must be set for all but 1 node in the SiteMap. The node with no parent key will be considered the root node. Note that when defining nodes in XML, the XML file must contain the root node.
You can disable XML configuration by setting the MvcSiteMapProvider_EnableSiteMapFile setting to "false". For an external DI configuration, you can disable XML parsing by removing the XmlSiteMapNodeProvider from the MvcSiteMapProvider DI module.
Alternatively, you can set the MvcSiteMapProvider_IncludeRootNodeFromSiteMapFile setting to "false" to exclude the root node from the XML file, but include all of the other nodes. For an external DI configuration, this setting can be found on the constructor of the XmlSiteMapNodeProvider.
SiteMapCacheKey: 'sitemap://localhost/'
Ambiguous Root Nodes:
ParentKey: '' | Controller: 'Home' | Action: 'Index' | Area: 'Admin' | URL: '/Admin' | Key: 'root' | Source: 'MvcSiteMapNodeAttribute'
ParentKey: '' | Controller: 'Home' | Action: 'Index' | Area: 'Admin' | URL: '/Admin' | Key: 'root' | Source: 'MvcSiteMapNodeAttribute'
my App.Settings
<add key="MvcSiteMapProvider_EnableSiteMapFile" value="false" />
<add key="MvcSiteMapProvider_IncludeRootNodeFromSiteMapFile" value="false" />
<add key="MvcSiteMapProvider_IncludeAssembliesForScan" value="dllmain,dll2" />
<add key="MvcSiteMapProvider_UseExternalDIContainer" value="false" />
<add key="MvcSiteMapProvider_ScanAssembliesForSiteMapNodes" value="true" />
I think it has to do, with the way sitemap is it initialized. It might be vulnerable to cross-thread operation. It might get double initialized.
Do you have any advice for this?
Thanks in advance.