This project is read-only.

Blog Engine Provider = DB but users are pulling from users.xml

Topics: ASP.NET 2.0, Controls
Aug 16, 2013 at 8:11 PM
Edited Aug 16, 2013 at 9:14 PM
For some reason my blog's users are being read through Users.XML and I would like it to be read from be_Users (the name of my SQL table).

<blogProvider defaultProvider="DbBlogProvider" fileStoreProvider="XmlBlogProvider">

I am using the filestore provider for the purpose of storing images, but i want all user and post data to be in the SQL database while at the same time pulling images from the filestore. Is this possible? All of our posts are coming from the SQL table, which is great, but not the user data. It looks like this issue began on July 1st, when I upgraded to the latest BE version 2.8. Prior to that, everything came from the be_Users table. all users that I've added since July 1 are in the XML instead of the table. I've already updated my be_Users table manually to match the XML so if there is a way I can just switch it over, that would be great!

If I move the users.xml file, I get the error on creating a new user:
"Could not create user: testuser2 : Could not find file 'C:\inetpub\wwwroot\mysite\blog\App_Data\users.xml'.

Here is a portion of my webconfig. Any help is greatly appreciated:
        <sectionGroup name="BlogEngine">
            <section name="blogProvider" requirePermission="false" type="BlogEngine.Core.Providers.BlogProviderSection, BlogEngine.Core" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/>
            <section name="blogFileSystemProvider" requirePermission="false" type="BlogEngine.Core.Providers.BlogFileSystemProviderSection, BlogEngine.Core" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/>
        <blogProvider defaultProvider="DbBlogProvider" fileStoreProvider="XmlBlogProvider">
                <add description="Xml Blog Provider" name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>
                <add connectionStringName="BlogEngine" description="Sql Database Provider" name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core"/>
        <blogFileSystemProvider defaultProvider="XmlBlogProvider">
                <add description="Xml Blog Provider" name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlFileSystemProvider, BlogEngine.Core"/>
                <add storageVariable="BlogEngine" description="Sql Database Provider" name="DbBlogProvider" type="BlogEngine.Core.Providers.DbFileSystemProvider, BlogEngine.Core"/>
                <!--<add storageVariable="\\UNCPath\BlogFiles" description="UNC Path Provider" name="UNCBlogProvider" type="BlogEngine.Core.Providers.UNCFileSystemProvider, BlogEngine.Core" />-->
        <add name="BlogEngine" connectionString="<HIDDEN>" providerName="System.Data.SqlClient"/>
        <add key="BlogEngine.FileExtension" value=".aspx"/>
        <!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
        <add key="BlogEngine.VirtualPath" value="~/"/>
        <!-- The regex used to identify mobile devices so a different theme can be shown -->
        <add key="BlogEngine.MobileDevices" value="(iemobile|iphone|ipod|android|nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)"/>
        <!-- The name of the role with administrator permissions -->
        <add key="BlogEngine.AdminRole" value="Administrators"/>
        <!-- The name of the role for anonymous(non-authenticated) users. -->
        <add key="BlogEngine.AnonymousRole" value="Anonymous"/>
        <!-- The name of the role for Editors -->
        <add key="BlogEngine.EditorsRole" value="Editors"/>
        <!--This value is to provide an alternative location for storing data.-->
        <add key="StorageLocation" value="~/App_Data/"/>
        <!--This value is the folder name under the StorageLocation that data for blog instances will be stored in.-->
        <add key="BlogInstancesFolderName" value="blogs"/>
        <!--A comma separated list of script names to hard minify. It's case-sensitive. -->
        <add key="BlogEngine.HardMinify" value="blog.js,widget.js,WebResource.axd"/>
        <!--Any data grid in the admin panel should use this value for default number of items per page.-->
        <add key="BlogEngine.GenericPageSize" value="20"/>
Aug 16, 2013 at 10:04 PM
Edited Aug 16, 2013 at 10:04 PM
You need to set membership and role providers to use database:
<membership defaultProvider="DbMembershipProvider">
<roleManager defaultProvider="DbRoleProvider" enabled="true" cacheRolesInCookie="false">
Aug 17, 2013 at 12:41 AM
Perfect. thank you lots rtur. You have helped me many times, I would buy you a cold one if I could. Cheers! You're a fantastic resource here.