This project is read-only.

Creating multiple blogs breaks users

Topics: Business Logic Layer
Jun 9, 2013 at 2:54 PM
I am using XML configuration of the root blog engine site. I have two users - "Andrew" and "Rachel".
When I create a second blog, in preparation for creating a Site Aggregation blog with two sub blogs, it creates a copy of the users.xml and roles.xml files, which contain the two users.
After an iisreset/app pool reset, the blog will not load:
Parser Error Message: Item has already been added. Key in dictionary: 'Andrew'  Key being added: 'Andrew'
 <add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider"/>
The solution is to clear out the users.xml and roles.xml in the ~/App_Data/blogs/test1/users.xml
However, this means I have to have separate users for each sub-blog?

I could not find a clear answer to this in the documentation - does the multiple blog mechanism support users across blogs? Can I have the "Andrew" user an administrator on the Site Aggregation main blog, as well as the sub blogs?
Jun 9, 2013 at 3:12 PM
Edited Jun 9, 2013 at 3:54 PM
I actually ran into a deeper issue with this. In order to configure the sub-blog, you need an administrative user, but creating the sub-blog as a copy of your current blog will create a matching administrative user, but will not let you log in as that user. And, certainly after an app pool restart, the blog will be broken due to my above error message.
Right now, I don't think there's any way to create a sub-blog, and then administer it...

Edit: I was able to manually edit the users and roles xml, creating an "Andrew1" administrative user as a copy of "Andrew" from the main site users.xml, and then editing the user's profile in the sub-blog so the display name is "Andrew", so it looks okay in my aggregation site...not the most ideal situation, but I'm now able to log in and post/administer the sub blogs.