Hit a bunch of gotchas doing this; figure I’d share with the world how I got it working.

1. RUN THE UPDATED SQL SCRIPT

There’s a piece of SQL script that isn’t in the setup script and can only be found if you download the source … or copy/paste from below :)

ALTER TABLE dbo.be_Pages ADD
    SortOrder int NOT NULL CONSTRAINT DF_be_Pages_SortOrder DEFAULT 0
GO
CREATE NONCLUSTERED INDEX IX_be_Pages ON dbo.be_Pages
    (
    SortOrder
    ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

2. BEWARE WEB.CONFIG INHERITANCE

Because of web.config inheritance from the root application, all kinds of wacky stuff can go wrong. Easiest fix is to turn off inheritInChildApplications like this:

 

<location path="." inheritInChildApplications="false">
<system.web>
...
</system.web>
</location>

Remember to do it from system.web and system.webserver. And for appsettings, unless you do #3 below.

3. ADD SOME APPSETTINGS

Even if you add that element to appSettings, you still may need to add the following appSettings:

<appSettings>
  <add key="webpages:Enabled" value="true" />
  <add key="webpages:Version" value="3.0.0.0" />
...
</appSettings>

4. CONFIGURE MEMBERSHIP AND ROLEMANAGER

If you are using Sql Server, of course you change the provider up at the top of web.config.

<BlogEngine>
   <blogProvider defaultProvider="DbBlogProvider" fileStoreProvider="DbBlogProvider">
...
    </blogProvider>
</BlogEngine>

But don’t forget to configure membership and roleManager to use the database. They are deeper down in web.config:

<membership defaultProvider="DbMembershipProvider">
  <providers>
    <clear />
    <add name="XmlMembershipProvider" type="BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core" description="XML membership provider" passwordFormat="Hashed" />
    <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="BlogEngine" applicationName="BlogEngine" />
    <add name="DbMembershipProvider" type="BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core" passwordFormat="Hashed" connectionStringName="BlogEngine" />
  </providers>
</membership>
<roleManager defaultProvider="DbRoleProvider" enabled="true" cacheRolesInCookie="false">
  <providers>
    <clear />
    <add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider" />
    <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="BlogEngine" applicationName="BlogEngine" />
    <add name="DbRoleProvider" type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core" connectionStringName="BlogEngine" />
  </providers>
</roleManager>

5. ADD A TRAILING SLASH WHEN YOU GO TO THE ADMIN

There’s a problem with the routing in the admin and you’ll get a blank page if you don’t add a trailing slash, aka http://locahost/blog/admin/ 

 

With those fixes, you should be able to get the best blogging platform written in .NET up and running!