Web.sitemap not found but exists

I have an ASP.net site and I created the web.sitemap file in the root directory. It contains:

<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode> <siteMapNode url="~/Default.aspx" title="Home" description="Rado Home" /> <siteMapNode url="" title="Structural" description=""> <siteMapNode url="" title="Doors" description=""/> <siteMapNode url="" title="Staircases" description=""/> <siteMapNode url="" title="Post Boxes" description=""/> </siteMapNode> <siteMapNode url="" title="Functional"> <siteMapNode url="" title="Tables" /> <siteMapNode url="" title="Features" /> </siteMapNode> <siteMapNode url="" title="Sculpture"> <siteMapNode url="" title="Wall" /> <siteMapNode url="" title="Free Standing" /> </siteMapNode> <siteMapNode url="" title="Smithing"> <siteMapNode url="" title="Gold" /> <siteMapNode url="" title="Silver" /> <siteMapNode url="" title="Copper" /> </siteMapNode> <siteMapNode url="~/About.aspx" title="About"/> <siteMapNode url="~/Contact.aspx" title="Contact"/> </siteMapNode> </siteMap> 

Then I created a menu on my main page as follows:

 <asp:SiteMapDataSource ID="SiteMapDataSource1" Runat="server" /> <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" Orientation="Horizontal" DataSourceID="SiteMapDataSource1" /> 

When I start the site, I get the following error: The file.sitemap required by XmlSiteMapProvider does not exist.

Any ideas on what might be wrong?

+4
source share
5 answers

I fixed it. Apparently, there were not enough permissions in the web.sitemap file, so any user on which the site was working could not read the file. On this note, does anyone know how I can find out which user a site accesses files like?

0
source

Does your web.config a sitemap section?

 <siteMap> <providers> <add name="SiteMapDataSource1" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider" siteMapFile="/MyApplication/Web.sitemap" /> <add name="AdminSiteMap" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider" siteMapFile="/MyApplication/Admin.sitemap" /> </providers> </siteMap> 

like this?

+2
source

Did you name the site map that web.sitemap created?

If not, then you need to clear the providers in the sitemap tag and add a new provider that includes the name of your site map.

This shows the default entry in the root web.config that needs to be cleared

+1
source

this problem can also occur if you created a site copying it from another site, but you forgot to create the corresponding application in IIS

0
source

follow step 8 at this link and your problem will be solved https://www.c-sharpcorner.com/UploadFile/2f59d0/implementing-sitemap-in-Asp-Net/ you need to create a map web.sitemap, not web. sitemap.xml.

0
source

Source: https://habr.com/ru/post/1347139/


All Articles