Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Cannot Find MySQL Host Even Though I'm Not Using MySQL

I am trying to get a simple web page up and running, which uses TreeView as well as an SiteMapDataSource. The TreeView is to list links on the web application. My data source for the site navigation is an XML file (Web.sitemap).

When I run this application in my web browser, I get the error: "Unable to connect to any of the specified MySQL hosts."

It says my error is on line 285:

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

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

I am not using MySQL or any RDBMS for my sitemap, so I am not sure why I am getting this error. I did Install MySQL onto my system, as well as the plugins for Visual Studio 2015, so could this be the problem?

Thanks.

like image 204
koeks525 Avatar asked Oct 05 '15 08:10

koeks525


1 Answers

I got the same problem in a BlogEngine site after installing another site with a WordPress application. The installation of WordPress included the installation of MySql, and an entry in the .NET Machine.config file. This is in a Windows Server 2012 R2. You can remove the entry from the machine configuration, but that might cause problems somewhere else. I opted to add a Remove key in the BlogEngine Web.Config file.

Note: added location in configuration file.

<system.web>
    <siteMap defaultProvider="PageSiteMap" enabled="true">
        <providers>   
            <remove name="MySqlSiteMapProvider" />
            ...
        </providers>
    </siteMap>
</system.web>

This solved the problem.

like image 141
Papa Ccompis Avatar answered Sep 18 '22 15:09

Papa Ccompis