mvcsitemap - Strange error with MvcSiteMapProvider. It some how find 2 root nodes -
i using mvcsitemapnode without xml decorator's way. said in post
i sure have 1 node empty root node. works, except times error.
there more 1 node declared without parent key. parent key must set 1 node in sitemap. node no parent key considered root node. note when defining nodes in xml, xml file must contain root node.
you can disable xml configuration setting mvcsitemapprovider_enablesitemapfile setting "false". external di configuration, can disable xml parsing removing xmlsitemapnodeprovider mvcsitemapprovider di module.
alternatively, can set mvcsitemapprovider_includerootnodefromsitemapfile setting "false" exclude root node xml file, include of other nodes. external di configuration, setting can found on constructor of 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 has do, way sitemap initialized. might vulnerable cross-thread operation. might double initialized.
do have advice this?
thanks in advance.
please have @ this answer setting mvcsitemapprovider areas. routes have configured using correct conventions or won't work right.
if have 1 node in entire site has not set parent node (or has set null or empty string) , using [mvcsitemapnode] attributes, caused assemblies being loaded appdomain more 1 time. check appdomain.currentdomain.getassemblies()
method see if target assemblies (in case dllmain
, dll2
) in result more once.
Comments
Post a Comment