Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 25th, 2015, 06:44 PM
Authorized User
 
Join Date: Dec 2008
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
Default Chapter 7, Site Map Data Source error

I _think_ I have typed the code exactly like the book says. I get this when I run the code on page 250:

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unable to connect to any of the specified MySQL hosts.

Source Error:
Line 283: <siteMap>
Line 284: <providers>
Line 285: <add name="MySqlSiteMapProvider" type="MySql.Web.SiteMap.MySqlSiteMapProvider, MySql.Web, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />
Line 286: </providers>
Line 287: </siteMap>

Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Conf ig\machine.config Line: 285

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248

My Frontend.master looks like this:
Code:
<%@ Master Language="VB" CodeFile="Frontend.master.vb" Inherits="MasterPages_Frontend" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
    <script src="/Scripts/modernizr-2.8.3.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div id="PageWrapper">
            <header><a href="/"></a></header>
            <nav>
                <asp:Menu ID="Menu1" runat="server" CssClass="MainMenu" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False"></asp:Menu>
                <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" />
            </nav>
            <section id="MainContent">
                <asp:ContentPlaceHolder ID="cpMainContent" runat="server">
                </asp:ContentPlaceHolder>
            </section>
            <aside id="Sidebar">
                Select a theme <br />
                <asp:DropDownList ID="ThemeList" runat="server" AutoPostBack="True">
                    <asp:ListItem>DarkGrey</asp:ListItem>
                    <asp:ListItem>Monochrome</asp:ListItem>
                </asp:DropDownList>
            </aside>
            <footer>Footer Goes Here</footer>
        </div>
    </form>
</body>
</html>
And the moment I remove this:
Code:
               <asp:Menu ID="Menu1" runat="server" CssClass="MainMenu" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False"></asp:Menu>
                <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" />
it begins to work.

Any idea what could be wrong? What does MySQL have to do here? I do have MySQL installed, but I _thought_ it would be totally separate from Visual Studio.
 
Old May 25th, 2015, 06:56 PM
Authorized User
 
Join Date: Dec 2008
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Solved it:

http://stackoverflow.com/questions/2...-connector-net

In other words, check that if you have MySQL connector installed, that you _don't_ have Web Providers installed.
  Spam!  
Old February 20th, 2016, 06:16 PM
Registered User
 
Join Date: Feb 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

If you follow pg 250 in the book to the letter and your site dint work.Manually Comment out the <sitemap> section (it's almost on the bottom of the file) in your machine.config file located in your .NET framework. Here is my part to the file:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Conf ig\machine.config

Save it as the administrator and violá. It works.

Solutions using sitemaps are intact solutions where I need to use the MySQL connector work as expected as well.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add new Site Map Node Rajasekar1988 ASP.NET 4 General Discussion 1 June 12th, 2012 08:30 AM
Site map menu and CSS markhh ASP.NET 4 General Discussion 9 August 3rd, 2011 05:39 PM
Roles and Site map etc. SPDmma BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 December 14th, 2008 04:27 PM
Site Map mallikalapati ASP.NET 2.0 Basics 1 February 9th, 2008 02:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.