defaultProvider

Topics: ASP.NET 2.0
Jul 1, 2008 at 2:37 PM
Hi,
 
thanks for the new version of the BlogEngine.NET. I have some issues with it.
I have SQL-connection to it, and there is 2 place there it's said
 
"defaultProvider="XmlProfileProvider" in the Web.Config file.
 
In line 9 and 66 it's says "defaultProvider="XmlProfileProvider" should i change it on line 66 to?
Coordinator
Jul 1, 2008 at 4:02 PM
Line #9 should say XMLBlogProvider by default, not XMLProfileProvider.

If you want to use a database, You'll want to change line #9 to use DbBlogProvider.

You also want to change the connectionString in line 23 to connect to your database.

That should get your blog data stored to your database, assuming, of course, you already have a database setup with the BlogEngine tables.

I'm working on a database setup guide.  Hopefully it will be ready soon.


Jul 1, 2008 at 5:06 PM
I tried to use sql server 2005 instead of xml database.but it shows me an configuration error that:

Could not load type 'BlogEngine.Core.Providers.MSSQLBlogProvider'. in web.config.

How to solve this issue.


thanks!!
Jul 1, 2008 at 7:09 PM


ajeet84 wrote:
I tried to use sql server 2005 instead of xml database.but it shows me an configuration error that:

Could not load type 'BlogEngine.Core.Providers.MSSQLBlogProvider'. in web.config.

How to solve this issue.


thanks!!

there is no sting called MSSQLBlogProvider'. It's called DbBlogProvider



Jul 9, 2008 at 11:30 AM
The detailed wiki instructions for Using the SQL Server Blog Provider by Razonant (seems to me) contradicts the replies above.
The wiki states the following configuration changes (below) to web.config for using a SQL database.
So my question is; what is the authoritive answer to get SQL Provider working? I've tried the specific change above for <blogProvider defaultProvider="DbBlogProvider"> which still displays the error below.

Quoting from the SQL Server Blog Provider wiki, specifically we replace the blogProvider for MSSQLBlogProvider:

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

and update our connectionStrings:

    <connectionStrings>
        <add name="BlogEngine" connectionString="Data Source=MEDUSA;
            User ID=me;Password=password;persist security info=False;
            initial catalog=notCommunityServer;" providerName="System.Data.SqlClient"/>
    </connectionStrings>

This is the detailed error: Any ideas folks?

Nick

Server Error in '/newBEsite' Application.

Configuration Error

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: Could not load type 'BlogEngine.Core.Providers.MSSQLBlogProvider'.

Source Error:

Line 10: 			<providers>
Line 11: <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider"/>
Line 12: <add name="MSSQLBlogProvider" type="BlogEngine.Core.Providers.MSSQLBlogProvider"/>
Line 13: </providers>
Line 14: </blogProvider>

Source File: C:\Inetpub\wwwroot\BlogEngine.NET\newBEsite\web.config    Line: 12

Jul 9, 2008 at 11:45 AM
Ah, right. Cracked it. Via Dave Burke (DBVT.com) he confirms that I'm reading out of date documentation (but where are the up-to-date docs?). Perhaps "For Version 1.4 see here" might have been more unambiguous.

The correct web.config configuration for SQL Provider is:

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


I hope that helps.

Nick
Coordinator
Jul 9, 2008 at 1:00 PM
You are right.  The wiki is outdated, but as soon as 1.4 was released, I put in a bold line at the top of the document that they were no longer valid as of 1.4.  (There are still people on 1.3 or earlier so I didn't want to remove the information completely.

I'll try to get around to updating it sometime, but it takes a lot of time.

For more info, I suggest you check here: Setting up BlogEngine.NET 1.4 to use SQL Server

If you like the full details: Demystifying the DbProviders in BlogEngine.NET


Jul 9, 2008 at 1:10 PM
Thanks RazorAnt -- appreciate the links. I'm only 2 weeks in with BE so still discovering where things are! Nick
Oct 22, 2008 at 5:40 PM
Edited Oct 22, 2008 at 5:41 PM

 Nick, thanks soooo much for posting. This had me stumped too. What  a big help your post is. Thanks again

 


--------------------------------------------------------------------------------------------------------
The correct web.config configuration for SQL Provider is:

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

Jul 2, 2010 at 8:23 AM

Hi everyone, i'm a new user and i have a problem with BlogEngine application.

This is error:

 

Configuration Error

Description: An error occured 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.

Parse Error Message: 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.

Source Error:

<BlogEngine>

        line 9:      <blogProvider defaultProvider="XmlBlogProvider">

                         <providers>

               line 11:                    <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>

Source File: E:\\WWWROOT\STOP\blogengine\blogengine_build\web.config line: 9

Could you help me?

 

Thank's a lot

Jul 2, 2010 at 8:35 AM
well, your error is self explanatory.
Configure your virtual directory as an application in IIS.

Regards,
Srini T.
--When you are playing cricket, you should hit the ball out of the ground OR get bowled;Both are fine .What you shouldn't do is defending your wickets.



-----Original Message-----
From: marcoski [mailto:[email removed]
Sent: Fri 7/2/2010 1:53 PM
To: Srinivas Reddy Thatiparthy
Subject: Re: defaultProvider [blogengine:30613]

From: marcoski

Hi everyone, i'm a new user and i have a problem with BlogEngine application.This is error: Configuration ErrorDescription: An error occured 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.Parse Error Message: 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.Source Error:<BlogEngine> line 9: <blogProvider defaultProvider="XmlBlogProvider"> <providers> line 11: <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>Source File: E:\\WWWROOT\STOP\blogengine\blogengine_build\web.config line: 9Could you help me? Thank's a lot