The SiteMapProvider 'MySiteMap' cannot be found.

G

Guest

I've got a pretty basic sitemap setup, but am getting a runtime error: "The
SiteMapProvider 'MySiteMap' cannot be found."

This occurs only when I access my website under IIS 5.1. When I run my app
under the debugger (localhost:1946) I have no problem. I thought of trying
IIS6.0, but am running XP, so can't upgrade to 6.0. Any ideas?

my web.config relevant lines
<siteMap>
<providers>
<add name="MySiteMap" type="System.Web.XmlSiteMapProvider, System.Web,
Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
siteMapFile="~/Web.sitemap"/>
</providers>
</siteMap>

Web.sitemap file:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Home" url="~/default.aspx" description="Home">
<siteMapNode description="HomeURL" title="Welcome" url="~/welcome.aspx" />
<siteMapNode description="AboutUsUrl" title="About Us"
url="~/aboutus.aspx" />
</siteMapNode>
</siteMap>

user control containing reference to sitemapprovider:
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
ShowStartingNode="False" SiteMapProvider="MySiteMap" />

The only other relevant detail is that the user control with the sitemap is
included in a master page, which is used by the page I'm referencing.
 
K

Ken Cox [Microsoft MVP]

Hi Adrian,

Just checking... Is your IIS5.1 Web set as an application? It might be that
"~/Web.sitemap" is making it look in a different root that you expect.

What happens if you use just

siteMapFile="Web.sitemap"/>

Ken
Microsoft MVP [ASP.NET]
 
G

Guest

Thanks for your response Ken. I tried your suggestion; it didn't help.
However....

your post got me to thinking about my IIS settings, re: default website. It
seems that it was pointing to an old version of my app. I fixed this, and now
my sitemap is happy.

There's still something odd going on there, because I could see changes I
made (like renaming my sitemap provider) reflected in the error screen... but
I continued to get the error.

Thanks for the help.
--
- Adrian


Ken Cox said:
Hi Adrian,

Just checking... Is your IIS5.1 Web set as an application? It might be that
"~/Web.sitemap" is making it look in a different root that you expect.

What happens if you use just

siteMapFile="Web.sitemap"/>

Ken
Microsoft MVP [ASP.NET]

Adrian Sharp said:
I've got a pretty basic sitemap setup, but am getting a runtime error:
"The
SiteMapProvider 'MySiteMap' cannot be found."

This occurs only when I access my website under IIS 5.1. When I run my app
under the debugger (localhost:1946) I have no problem. I thought of trying
IIS6.0, but am running XP, so can't upgrade to 6.0. Any ideas?

my web.config relevant lines
<siteMap>
<providers>
<add name="MySiteMap" type="System.Web.XmlSiteMapProvider,
System.Web,
Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
siteMapFile="~/Web.sitemap"/>
</providers>
</siteMap>

Web.sitemap file:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Home" url="~/default.aspx" description="Home">
<siteMapNode description="HomeURL" title="Welcome" url="~/welcome.aspx"
/>
<siteMapNode description="AboutUsUrl" title="About Us"
url="~/aboutus.aspx" />
</siteMapNode>
</siteMap>

user control containing reference to sitemapprovider:
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
ShowStartingNode="False" SiteMapProvider="MySiteMap" />

The only other relevant detail is that the user control with the sitemap
is
included in a master page, which is used by the page I'm referencing.
 
K

Ken Cox [Microsoft MVP]

Hi Adrian,

Glad to hear you got going anyway!

Ken
Microsoft MVP [ASP.NET]



Adrian Sharp said:
Thanks for your response Ken. I tried your suggestion; it didn't help.
However....

your post got me to thinking about my IIS settings, re: default website.
It
seems that it was pointing to an old version of my app. I fixed this, and
now
my sitemap is happy.

There's still something odd going on there, because I could see changes I
made (like renaming my sitemap provider) reflected in the error screen...
but
I continued to get the error.

Thanks for the help.
--
- Adrian


Ken Cox said:
Hi Adrian,

Just checking... Is your IIS5.1 Web set as an application? It might be
that
"~/Web.sitemap" is making it look in a different root that you expect.

What happens if you use just

siteMapFile="Web.sitemap"/>

Ken
Microsoft MVP [ASP.NET]

Adrian Sharp said:
I've got a pretty basic sitemap setup, but am getting a runtime error:
"The
SiteMapProvider 'MySiteMap' cannot be found."

This occurs only when I access my website under IIS 5.1. When I run my
app
under the debugger (localhost:1946) I have no problem. I thought of
trying
IIS6.0, but am running XP, so can't upgrade to 6.0. Any ideas?

my web.config relevant lines
<siteMap>
<providers>
<add name="MySiteMap" type="System.Web.XmlSiteMapProvider,
System.Web,
Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
siteMapFile="~/Web.sitemap"/>
</providers>
</siteMap>

Web.sitemap file:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Home" url="~/default.aspx" description="Home">
<siteMapNode description="HomeURL" title="Welcome"
url="~/welcome.aspx"
/>
<siteMapNode description="AboutUsUrl" title="About Us"
url="~/aboutus.aspx" />
</siteMapNode>
</siteMap>

user control containing reference to sitemapprovider:
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
ShowStartingNode="False" SiteMapProvider="MySiteMap" />

The only other relevant detail is that the user control with the
sitemap
is
included in a master page, which is used by the page I'm referencing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top