Integrating Blog Engine 3.3 with existing site throws exception

Jan 12 at 11:52 AM
I get the following exception while trying to integrate blog engine with existing website

A network-related or instance-specific error occurred while establishing a connection to SQL Server.

<add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider" />

I am not even using SQL as role provider. My Existing website is based on ASP.NET 4. I copied the blog engine application to a folder called blogs, merged the web.config files as was mentioned on few other blogs.

Please help me get past this issue.
Jan 13 at 12:36 AM
Edited Jan 13 at 12:38 AM
There are lots of other examples in this discussion forum where people have tried to merge Blogengine with another application and have become stuck. I run Blogengine alongside my existing site, but I've done it in a slightly different way.

Load the Blogengine files into their own directory under inetpub, or wherever you want to keep the application files. In IIS Manager right click on your existing site and select 'add application' then follow the prompts.

Now you just need to prevent Blogengine from inheriting settings from your original application's web.config file. To do that you have to wrap individual web.config sections in your original application's web.config file with the following:
<location path="." inheritInChildApplications="false">
In my own application's web.config file I've wrapped the following sections
<configuration>
  <configSections>
  <location path="." inheritInChildApplications="false">
    <appSettings>
    </appSettings>
  </location>
  <location path="." inheritInChildApplications="false">
    <system.web>
    </system.web>
  </location>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
    </system.webServer>
  </location>
  <location path="." inheritInChildApplications="false">
    <system.codedom>
    </system.codedom>
  </location>
</configuration>
If I recall correctly, the Blogengine web.config file does not need to be modified.
Hope that helps!
Marked as answer by Adit_Tripathi on 2/13/2017 at 6:11 AM
Feb 13 at 2:12 PM
Thanks, the solution worked..