Unable to find the requested .Net Framework Data Provider. It may not be installed.

Topics: ASP.NET 2.0
Aug 1, 2008 at 6:36 PM
Hi,

I got this error when upgrading to BlogEngine.NET 1.4.5

Unable to find the requested .Net Framework Data Provider.  It may not be installed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
   System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1447431
   BlogEngine.Core.Providers.DbBlogProvider.LoadSettings() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\Providers\DbBlogProvider.cs:1068
   BlogEngine.Core.BlogSettings.Load() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\BlogSettings.cs:1640
   BlogEngine.Core.BlogSettings..ctor() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\BlogSettings.cs:223
   BlogEngine.Core.BlogSettings.get_Instance() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\BlogSettings.cs:250
   BlogEngine.Core.Web.HttpModules.ReferrerModule..cctor() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\Web\HttpModules\ReferrerModule.cs:81

[TypeInitializationException: The type initializer for 'BlogEngine.Core.Web.HttpModules.ReferrerModule' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +268
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1036
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +114
   System.Web.Configuration.Common.ModulesEntry.Create() +41
   System.Web.Configuration.HttpModulesSection.CreateModules() +203
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1006
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +259
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +114
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +350

If i didnt use the database, all ok. If i change to MySQL database, this error occured..

Please, help..
Aug 1, 2008 at 6:57 PM
You probably got the initial MySQLWeb.config that has a missing code.
This issue was already fixed on the source...

but to fix this issue for now, on MySQLWeb.config include the following code that should be above system.web

<system.data>
<DbProviderFactories>
<clear />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,
Version=5.1.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

It should work now :)
Aug 2, 2008 at 7:42 PM
Unfortunately for me, its not working...

I got this error instead...

No such host is known
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No such host is known

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SocketException (0x2af9): No such host is known]
   System.Net.Dns.GetAddrInfo(String name) +506
   System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) +143
   System.Net.Dns.GetHostEntry(String hostNameOrAddress) +109
   MySql.Data.Common.StreamCreator.GetHostEntry(String hostname) +89
   MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) +295
   MySql.Data.MySqlClient.NativeDriver.Open() +179

[MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
   MySql.Data.MySqlClient.NativeDriver.Open() +238
   MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +61
   MySql.Data.MySqlClient.MySqlPool.GetConnection() +142
   MySql.Data.MySqlClient.MySqlConnection.Open() +335
   BlogEngine.Core.Providers.DbBlogProvider.LoadSettings() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\Providers\DbBlogProvider.cs:1079
   BlogEngine.Core.BlogSettings.Load() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\BlogSettings.cs:1640
   BlogEngine.Core.BlogSettings..ctor() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\BlogSettings.cs:223
   BlogEngine.Core.BlogSettings.get_Instance() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\BlogSettings.cs:250
   BlogEngine.Core.Web.HttpModules.ReferrerModule..cctor() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\Web\HttpModules\ReferrerModule.cs:81

[TypeInitializationException: The type initializer for 'BlogEngine.Core.Web.HttpModules.ReferrerModule' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +268
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1036
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +114
   System.Web.Configuration.Common.ModulesEntry.Create() +41
   System.Web.Configuration.HttpModulesSection.CreateModules() +203
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1006
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +259
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +114
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +350


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

What is the problem?

Can you send me the working web.config file?
Aug 2, 2008 at 10:46 PM
I am not familiar with the Ms SQL Provider, but the socket exception that says "no such host" means your application can not find the computer that the socket is trying to connect to...

Did you specify the correct information in your connection string?  According to this article on setting up MySQL for BlogEngine.Net 1.4, your connection strings setting should look like this, where LocalHost and MySql server are the the name of the machine running mySQL and initial catalog is the name of the BlogEngine Database

   1: <connectionStrings>
   2:         <clear/>
   3:         <add name="LocalSqlServer" connectionString="dummy"/>
   4:         <!-- Mono complains if LocalSqlServer isn't specified -->
   5:         <add name="BlogEngine" 
   6:              connectionString="Data Source=MySQLServer;User ID=user;Password=password;persist security info=False;initial catalog=BlogEngine;" 
   7:              providerName="System.Data.SqlClient"/>
   8:         <add name="MySQLDB" 
   9:              connectionString="Server=localhost;Database=blogengine;Uid=beUser;Pwd=beUser;" 
  10:              providerName="MySql.Data.MySqlClient"/>
  11:     </connectionStrings>
Aug 3, 2008 at 4:28 AM
Hi guys, thanks for the help.

I managed to upped the blog in MySQL by changing the MySQLServer to localhost..Hahha
Aug 3, 2008 at 12:02 PM
Glad we could help
Aug 27, 2008 at 6:04 AM

I'm getting this same error, but I've done everything above, including changing the "localhost" string to my actual database.... I'm at my wit's end and I'm gonna start throwing stuff.

Please help :(

Aug 30, 2008 at 2:20 PM
Solved! The problem was my hosting company had a stray character in their machine.config file.... unf***ingbelievable....
Aug 31, 2008 at 1:04 AM
Edelman,

unf**ingbelievable is right!  Geez-o-wiz!  Glad you're up and that you stayed with the program during the dark time.

Regards,
Dave