BlogEngine Taking Over Site

Topics: ASP.NET 2.0
Jul 11, 2011 at 7:06 AM

Hi,

I’ve just integrated BlogEngine into an existing site, it’s all working well locally on my computer but online I am getting errors in non relevant areas, saying “Could not load file or assembly 'BlogEngine.Core' or one of its dependencies. The system cannot find the file specified”. This is coming from inside a directory that has no reference to BlogEngine at all.

Any ideas on how I can stop it taking over the rest of the site.

Cheers,

Mike.

Coordinator
Jul 11, 2011 at 10:06 AM

It sounds like you have BE setup, and then you have a child application(s) under BE where these error(s) are occurring.

What's happening is the BE settings in the BE web.config file are propagating down to the sub-applications.

Take a look at this thread, my post on Mar 2 2010.  You can see it wraps up the <system.web> section and the <system.webServer> section in <location> tags with the inheritInChildApplications attribute set to false.  You should modify your BE web.config file, by wrapping those 2 sections in those <location> tags.  This will prevent the BE settings from propagating down to the child application(s).

Jul 11, 2011 at 11:05 AM

Thanks BenAmada,

It’s all to entrenched in one another now, if I change one thing the other doesn’t work. I think what I need to do is break my web.config files up and have separate ones for each folder or something.

But while I have you, do you have any idea why it works in my local server but not on my host server, or how can I tell that directory, “There you go, there is BlogEngine” It’s just that one directory that seems to have the problem.

Cheers,

Mike.

From: BenAmada [email removed]
Sent: Monday, July 11, 2011 7:06 PM
To: mike@fnesse.com
Subject: Re: BlogEngine Taking Over Site [blogengine:264620]

From: BenAmada

It sounds like you have BE setup, and then you have a child application(s) under BE where these error(s) are occurring.

What's happening is the BE settings in the BE web.config file are propagating down to the sub-applications.

Take a look at this thread, my post on Mar 2 2010. You can see it wraps up the <system.web> section and the <system.webServer> section in <location> tags with the inheritInChildApplications attribute set to false. You should modify your BE web.config file, by wrapping those 2 sections in those <location> tags. This will prevent the BE settings from propagating down to the child application(s).

Jul 11, 2011 at 11:36 AM

I’m going to have to separate the web.config files somehow. BlogEngine is located in the root directory of my hosting space. It occurred to me to check all my other sites residing in folders in the same directory and none of my sites were working.

I have never had to do anything like this before, can you direct my to a tutorial where that will show me how to do this.

Cheers,

Mike.

Coordinator
Jul 12, 2011 at 10:46 AM

There's two basic scenarios.  One is where the applications are separate, and they each have their own web.config file and and they each have their own BIN directory, and they each have their own App_Code and App_GlobalResources folders etc.  In this scenario, one application is installed in a sub-folder and that sub-folder is marked as an application, or sub-application in IIS.  This is the easier scenario to deal with because the applications are mostly independent of one another.  Except for the situation where the parent applications's settings propagate down to the child application.  To avoid this from happening, that's when you would use the <location> tags with the inheritInChildApplications attribute.

The 2nd scenario is where you merge 2 applications into a single application.  In this case, they share a single web.config file, and share a single BIN directory and share the App_Code, App_GlobalResource folders, etc.  In this case, you don't need the <location> tags with the inheritInChildApplications attribute since it's only one application.  Overall this 2nd scenario is a little bit harrier since you need to merge the web.config files, and some pages/code in one application can more easily interfere with the pages/code in the other application.

I'm not sure right now which situation you are in.  Ideally, scenario 1 is better to shoot for.

Aug 18, 2011 at 12:29 AM

I couldn't find my answer so I am reviving an older thread. I am trying to do scenero 2.

I have a shopping cart solution and am trying to integrate BE 2.5. I have combined the 2 web.config files but when navigating to the /shop/ directory (the shopping cart) it displays the  BE defaul.aspx

Any thoughts on where I should start looking to get BE to stop this behavior?

The shopping cart  script is set up differently than BE, with the web.config and bin directory in the root but all of the cart pages in the shop directory.

 

Thanks!

Aug 18, 2011 at 2:07 AM

Hi, I'm trying to do the scenario 2 (as 1 application) as well but running into a few difficult situations.  First, I came across this page (since I have their products) and tried to mimic the site so I can have a better understanding of BE.  The site is:  www.wdtvlive.com.

My thinking that I need to have BE as 1 application is because the main page pulls in the 3 latest blog posts.  If I separate the two applications like scenario 1 as BenAmada mentioned above, then I'm not sure how I can get the 3 latest blog posts to post on the main page in addition to a blog page.  I think scenario 1 is cleaner but I'm not sure how to access the database from my application to retrieve the blogs from BE and post it on the main page.  Any suggestions in attacking this problem?  Should I set up as 1 application and let BE run the entire show or separate into 2 applications and have my main site pull the blogs from BE database?  If 2 separate apps, is it possible to retrieve the blog posts?

Complications With BE as the Only Application:

1 - If I create a page and set it as a front page, the url becomes: www.mysite.com/pages/whatever.aspx and I need it to be just simply: www.mysite.com

2 - If I create a page, say like the wdtvlive.com product page, where the content is dynamic and pulls in from XML and formats using XSL, I don't know how to modify the page.  I can't seem to locate that pages I created in the admin panel to put the codes to pull in the XML and format onto the page with XSL.

Anyone with a better solution to handle this?

Thank you

Aug 18, 2011 at 3:11 AM

I’ve set it up in a similar way as two stand alone applications by building my own widget to display latest posts and then Included it in an Iframe on the home page. That worked for me on this occasion.

Cheers,

Mike.

From: cazarez [email removed]
Sent: Thursday, August 18, 2011 11:08 AM
To: mike@fnesse.com
Subject: Re: BlogEngine Taking Over Site [blogengine:264620]

From: cazarez

Hi, I'm trying to do the scenario 2 (as 1 application) as well but running into a few difficult situations. First, I came across this page (since I have their products) and tried to mimic the site so I can have a better understanding of BE. The site is: www.wdtvlive.com.

My thinking that I need to have BE as 1 application is because the main page pulls in the 3 latest blog posts. If I separate the two applications like scenario 1 as BenAmada mentioned above, then I'm not sure how I can get the 3 latest blog posts to post on the main page in addition to a blog page. I think scenario 1 is cleaner but I'm not sure how to access the database from my application to retrieve the blogs from BE and post it on the main page. Any suggestions in attacking this problem? Should I set up as 1 application and let BE run the entire show or separate into 2 applications and have my main site pull the blogs from BE database? If 2 separate apps, is it possible to retrieve the blog posts?

Complications With BE as the Only Application:

1 - If I create a page and set it as a front page, the url becomes: www.mysite.com/pages/whatever.aspx and I need it to be just simply: www.mysite.com

2 - If I create a page, say like the wdtvlive.com product page, where the content is dynamic and pulls in from XML and formats using XSL, I don't know how to modify the page. I can't seem to locate that pages I created in the admin panel to put the codes to pull in the XML and format onto the page with XSL.

Anyone with a better solution to handle this?

Thank you

Aug 18, 2011 at 3:57 AM

Hi Mike,

Do you mind sharing me how you exactly did it so I can learn?  Thank you

Aug 18, 2011 at 5:19 AM

I just create a new page, recentPosts.aspx to display only the RecentPost like below, I can then plug it in via an Iframe anywhere I need it. I write this tentatively as there is probably other better ways to do it but this worked for me.

<%@ Page Language="C#" %>

<%@ Import Namespace="BlogEngine.Core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Recent Posts</title>

<link rel="stylesheet" href="recent_posts.css" type="text/css" />

</head>

<body>

<h3>Recent Blog Posts

</h3>

<blog:RecentPosts runat="server" />

</body>

</html>

Cheers,

Mike.

From: cazarez [email removed]
Sent: Thursday, August 18, 2011 12:58 PM
To: mike@fnesse.com
Subject: Re: BlogEngine Taking Over Site [blogengine:264620]

From: cazarez

Hi Mike,

Do you mind sharing me how you exactly did it so I can learn? Thank you

Aug 18, 2011 at 6:47 PM

Thanks, Mike.  I'm going to try that out.