Integrate BE 2.5 with existing website does not work

Topics: ASP.NET 2.0, Business Logic Layer, Controls
Sep 1, 2011 at 11:59 AM

I am currently running my blog on BE 1.6 version and was trying to integrate BE 2.5.
My website's structure is like this (

1. Root     ->Contains my custom code and some pages.
2. Root\Blogs\ -> Contains all BE specific code. Some common folders like app_FOLDERS are in Root.
3. Root\Forum1 -> This folder contains code for YAF (Yet Another Forum).

Now, when i run my site, system is able to run my custom pages from root, BE when I link to Root\Blogs\Default.aspx and Forum when i link to Root\Forum1\Default.aspx.

But this scenario does not work with BE 2.5. When i try to fit-in BE in the above structure, it always shows up the BE home page i.e. does not matter if i am at Root\Default.aspx or Root\Forum1\Default.aspx or Root\Blogs\Default.aspx. All three links show the home page of BE 2.5.

This behavior is really different than BE 1.6 oe BE 2.0. I tested the same scenario in BE2.0 and it works fine but breaks in BE 2.5.

Do you have any idea about what could be causing this issue. Also, I would appreciate if you can throw some light on how to integrate BE 2.5 wth existing website.

Oct 26, 2011 at 4:25 PM

Similar issue here. 

While I have successfully integrated BE 1.6 into a '/blog' directory of an existing Web site, I have so far been unsuccessful doing so with BE 2.5.

BlogEngine is a fantastic project, but it is very frustrating that the authors have seemingly not considered this common requirement.  There should be a simple, well supported way to enable BE to run from a site subdiretory, and share common theming with the main site.  Many business and commercial sites require robust "Web 1.0" content, with the "Web 2.0" content relegated to a 'News' section.  BE *should* be perfect for this.


Oct 26, 2011 at 6:20 PM

It seems like to me it might be the app_pool

BE 1.6 does not use the app_pool as much as BE 2.0 and BE 2.5 does.

BE 2.0 does use the app_pool more than 1.6 so not sure why BE 2.0 works and BE 2.5 doesn't.

BE 2.0 vs BE 2.5 is that it has multi blog feature which has the /directories  as blogs and virtual

non-actual existing folders.

This is where the problem is it seems.

But to double check that your app_pool is set up correctly

Also BE must have its own app_pool it can't not be shared with the others.

Make sure it has it own app_pool


Check your settings by downloading this checker:


Upload this folder on your web server.

Then go to

All lights should be green.

Also place this folder in your BE only folder too.


Also place it in any other /folders that are sites Like YAF and etc.

Double check that each "Site" has its own app_pool.

The checker will tell you whats wrong.


Other possible problem is the web.config file.

Do you have 1 web.config file or do you have one for each site?

You need to have a

root web.config  defining the "Global" settings

Then have a web.config in each site /site directory

Make sure to have BE locked down to only its directory and not the entire site.

This can be done with the web.config settings.


Also read this post from Rtur

Have a good day,

Brian Davis

Java Blog

Oct 26, 2011 at 7:25 PM
Edited Oct 26, 2011 at 7:28 PM

Thanks Brian.

I think one issue is that some BE users are not necessarily expert at IIS configuration, and may not even have a development server to build and test against.  For example, I am not a full time Web developer, and I do most of my site development on a client machine using either IIS Express and/or the Expression Web Development Server.  Configuring IIS applications and managing the app pool is therefore not obvious.

Most of the availble tutorials on installing BE into the subdirectory of an existing site do not consider use of multiple Web.config files, but rather movnig the BE runtime files into a subdirectory and fixing up the paths in the various source files.  Since there are so many dependencies (not all of which seem to be documented yet in 2.5), this is not so straightforward as in the past.

It would be really fantastic if a special distribution of BE could be created that already located everything into a subdirectory and was set up for site integration.  Or perhaps, some additional tutorials and walkthroughs on how to do this that are relevant to the 2.5 (and future) release(s).



Oct 27, 2011 at 1:04 AM
Edited Oct 27, 2011 at 2:07 AM

FYI, we decided to tackle this problem in a different way.  

BE 2.5 has a fairly robust "Pages" feature where you can define static pages that exist outside of the blog post chronology.  A static page can even be made the home page of a your site (in which case the blog is addressed at

One problem is that there is only basic control over styling of these pages through the blog control panel.  In our case, we wanted our site home page to have a different look than the rest of the site. 

The solution we found was to dynamically change the masterpage at runtime if the page being rendered is the "home page" for the site.  This can be done by adding a Page_PreInit event handler to the page.aspx.cs file. 

The following tests to see if the page being initialized is the site "home" page (we use the 'Slug' attribute for this), and if so, it changes the masterpage programmatically:

    /// <summary>
    /// PreInit event handler for the page
    /// Used to dyanamically switch the masterpage for the site Home page
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_PreInit(Object sender, EventArgs e)
        var queryString = this.Request.QueryString;
        var qsId = queryString["id"];

        if (qsId != null && qsId.Length == 36)
            var pg = BlogEngine.Core.Page.GetPage(new Guid(qsId));
            if (pg != null && pg.Slug == "Home")
                    this.MasterPageFile = Utils.RelativeWebRoot + "themes/yourSiteNameHere/homepage.master";

Using this approach (and some other tricks), I think we can make the site totally functional without messing with the organization of the BlogEngine.Net runtime files and folder structure. :-)  Hopefully, this might help some others.



Oct 27, 2011 at 2:24 PM


Thanks so much for your reply.  Without changing any IIS settings, I was able to get the blog up and working by creating an additional web.config that was placed in the blog folder.  I did have to move some of the settings to the main web.config and removed some other settings altogether.  I was hoping that you could post the contents of your two web.config files (minus any sensitive information) so that I could make sure everything is where it needs to be.



Feb 2, 2012 at 1:06 PM

I've read some blogs where the web.config is split, and I have tried switching elements here and there to no avail, although I have gotten close. But the blog simply takes control over the whole site. I don't know much about web.config; has anyone reached a solution yet with 2.5?

Feb 2, 2012 at 1:16 PM

As per Anil Gupta's original post: I have YAF which does work no matter what I do with BE. The web.config in said folder is a basic one, it's in .php; and the home page is index.php. Now, in another not-yet-mentioned folder, which also used to be taken over by BE (just some custom pages of my own), I changed the home page from "default.aspx" to "index.aspx"; and this has since resisted BE taking over it again.

A little bit close each time.

Feb 2, 2012 at 2:25 PM
Edited Feb 2, 2012 at 2:26 PM

Hey, guys,

We've been using BlogEngine.NET's multiple blog configuration in Sueetie since it's release.  They are integrated into the site via ASPNET Membership and there is no "taking over of the site" if I understand the issue. We're also using YetAnotherForum.NET, which is also fully integrated in Sueetie through ASPNET Membership.  I documented the configuration on the Sueetie Wiki if you want to scan through it.  The first section is Sueetie-specific, but there are several BE.NET-specific screenshots covering the configuration.

Good luck,

Feb 3, 2012 at 10:35 AM

I'd like to run the "check" (thanks for this by the way) on the server, but BE overtakes this too. Any suggestions (I'm rather new to ASP.NET)?

Is that any folder with default.aspx becomes part of the BE Application?

Feb 16, 2012 at 12:58 PM

Have any of you guys had any success passing the authentication ticket from your parent application to the  This work great for me in BE 1.6 but since upgrading to 2.5 my blog no longer recognizes authenticated users from my parent application.  Not only that, a user who is authenticated in the parent app, who then visits the blog, will go back to the parent application to see that they have been logged-out.  Wonderful.

I am running the ASPPlayground forum as a sub-application next to and ASPPlayground recognizes users from my parent application just fine.

Feb 16, 2012 at 9:38 PM
Edited Feb 16, 2012 at 9:52 PM

I'm still trying to sort this out myself.  We have what seems to be a typical setup:


The Blog folder is a separate virtual directory running in it's own App Pool.  The main site runs fine.  The Blog though fails to start with the following:

Could not load file or assembly 'TradeSchools.Web' or one of its dependencies. The system cannot find the file specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 I've been messing with the /Web.config and the /Blog/Web.config but still continually get this error.  It's weird because the /blog/ shouldn't even know about the assemblies from the parent site.

I'd sure appreciate if anyone could shed some light on this.

Feb 17, 2012 at 12:17 AM
Hellfire wrote:

Could not load file or assembly 'TradeSchools.Web' or one of its dependencies. The system cannot find the file specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 I've been messing with the /Web.config and the /Blog/Web.config but still continually get this error.  It's weird because the /blog/ shouldn't even know about the assemblies from the parent site.

If you're calling any DLLs in the root web.config via httpModules or as Control Prefixes for two examples, the BE.NET application needs to have a reference to them.  In other words, copy TradeSchools.Web "or one of its dependencies" into your /blog/bin folder and you should be good.


Feb 17, 2012 at 2:38 PM
Edited Feb 17, 2012 at 2:44 PM

Thanks Dave.  Putting the DLL into BE's bin didn't turn out to be the solution but it did put me on the right path to the solution.  I ended up adding <remove name="TradeSchoolsModule"/> along with some <remove namespace="TradesSchools.NameSpace" /> to the Web.config and cleared it up.

Feb 17, 2012 at 8:06 PM


Thanks for following up.  Smart approach on adding those <remove /> items to your web.config.  Sorry I didn't think to mention it.