SiteMapPath Control

Posted on 2006-04-12
Last Modified: 2011-04-14
Hello All,

I have a book called "Beggining ASP.NET 2.0" by WROX.

Right now I am in Chapter 3 trying to do the example on SiteMapPath Control on page 88.
Whenever I run it, I get the following error and I can't figure out why it's happening.

"It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS."

First of all, why is "IIS" being mentioned.  Isn't it supposed to be "Cassini"?

Thank you any help will truly be appreciated.  Thanks.
Question by:Isaac
    LVL 3

    Expert Comment

    Well, I'd need more information, could you post your web.config file here, as it is most likely there the problem lies.
    LVL 5

    Author Comment

    <?xml version="1.0"?>
    <!-- Note: As an alternative to hand editing this file you can use the web admin tool to
           configure settings for your application. Use the Website->Asp.Net Configuration option
           in Visual Studio.
         A full list of settings and comments can be found in machine.config.comments usually
         located in \Windows\Microsft.Net\Frameworks\v2.x\Config -->
        Mode defines certain feature availability:
          Full: No restrictions
          Real: Runs as if a real site, without the view code, download and user/role view links
        <add key="mode" value="Full" />
                define the connection string to the database
         <add name="WroxUnited"
               connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|WroxUnited.mdf;Integrated Security=True;User Instance=True"
               providerName="System.Data.SqlClient" />

          <add name="Page" type="Wrox.Web.GlobalEvents.ThemeModule" />

                Set compilation debug="true" to insert debugging symbols into the compiled page.
                Because this affects performance, set this value to true only during development.
        <compilation debug="true">
                      Set forms authentication and define the login page
        <authentication mode="Forms">
          <forms loginUrl="Default.aspx" />
                      Enable the role manager
                      This controls access to pages and the visibility of certain menu items
        <roleManager enabled="true"/>
        <anonymousIdentification enabled="true"/>
                The <customErrors> section enables configuration of what to do if/when an unhandled
                error occurs during the execution of a request.  Specifically, it enables developers
                to configure html error pages to be displayed in place of a error stack trace.

                <customErrors mode="RemoteOnly">
          <error statusCode="404" redirect="missingPage.aspx"/>

                      Redefine the Site Map Provider, to add the security trimming attribute,
                      which is off by default
        <siteMap defaultProvider="AspXmlSiteMapProvider" enabled="true">
            <add name="AspXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
              siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>

                      Define the SMTP Mail server settings
                      Required for the PasswordRecovery control (and possibly mailshots)
                <smtpMail from="" serverName="your_smtp_server">
                      Define the user profile properties
        <profile enabled="true">
            <add name="MemberName"/>
            <add name="Name"/>
            <add name="Address"/>
            <add name="City"/>
            <add name="County"/>
            <add name="PostCode"/>
            <add name="Country"/>
            <add name="Mailings" type="System.Boolean"/>
            <add name="Email"/>
            <add name="Theme"/>
            <add name="Cart" serializeAs="Binary" type="Wrox.Commerce.ShoppingCart" allowAnonymous="true"/>

    LVL 3

    Accepted Solution

    Hmm, I can't see any thing wrong with this code, as I have tested it.
    However I still belive the problem lies in a web.config file
    Do you have other web.config's in other folders, because it is most likly there the problem lies.
    The problem is that your trying to override a setting set in the root, or at application level, that requires the the folder to be set as an virtual directory, and thus get a new application i IIS.
    Since this i cassini, i'm not sure how do this, but what I would have done is to change the .config file in question so that it doesn't break the website.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now