Expecting non-empty string for 'providerInvariantName' parameter

Jun 26, 2009 at 7:38 AM

Hello,

BlogEngine.NET v. 1.5

Localhost - everything work perfect,

Remote hosting - exception:


Stack Trace:

[ArgumentException: Expecting non-empty string for 'providerInvariantName' parameter.]
  System.Data.Common.ADP.CheckArgumentLength(String value, String parameterName) +2105145
  System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +21
  BlogEngine.Core.Providers.DbBlogProvider.LoadSettings() +239
  BlogEngine.Core.Providers.BlogService.LoadSettings() +46
  BlogEngine.Core.BlogSettings.Load() +130
  BlogEngine.Core.BlogSettings..ctor() +65
  BlogEngine.Core.BlogSettings.get_Instance() +77
  BlogEngine.Core.Web.HttpModules.CompressionModule.System.Web.IHttpModule.Init(HttpApplication context) +39
  System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +406
  System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188
  System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +295
  System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
  System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231

[HttpException (0x80004005): Expecting non-empty string for 'providerInvariantName' parameter.]
  System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
  System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
  System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333

My connection string:

 <connectionStrings>
  <clear/> 
  <add name="BlogEngine" connectionString="Data Source=dbserver;Initial Catalog=blog_db;uid=login;pwd=pass" providerName="System.Data.SqlClient"/> 
  </connectionStrings>

 What's wrong?


 

Coordinator
Jun 26, 2009 at 11:05 AM

I would check the <BlogEngine> section in your web.config file.  Specifically the "defaultProvider" attribute.  If you're using a DB, then it should look something like:

<BlogEngine>
    <blogProvider defaultProvider="DbBlogProvider">
        <providers>
            <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>
            <add name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" connectionStringName="BlogEngine"/>
        </providers>
    </blogProvider>
</BlogEngine>

Coordinator
Jun 26, 2009 at 11:12 AM

There's a small number of hits on Google for this error ... but they all seem to point to not having providerName="System.Data.SqlClient" in your connection string, however you do have that.  Hmm ...