This project is read-only.

Why can't I install BE.NET as a .NET 4.0 Application?

Jan 7, 2011 at 8:46 AM

Hey everyone,

I'm building a site using Umbraco as the back end CMS and I want to use BlogEngine.NET as the blogging application (since blog4umbraco is lacking in features).

I've built a .NET site before and added BlogEngine.NET as an IIS application and it worked fine... no errors. Everything worked fine with previous .NET versions. But now that my Umbraco installation is running .NET 4.0, I can't get BlogEngine.NET running as an application within Umbraco.

If I install the latest 2.0 version of BlogEngine.NET and run it as an application in a .NET 2.0 site, it works fine.

If I install the latest 2.0 version of BlogEngine.NET and run it as an application in a .NET 4.0 site, it gives me a HTTP Error 500.19 "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined"

If I install the latest 2.0 version of BlogEingine.NET and run it as an application in a .NET 4.0 site, and upgrade the web.config file to .NET 4.0 using Visual Studio 2010, and try to run the blog, I get a server error "Could not load file or assembly 'UrlRewritingNet.UrlRewriter' or one of its dependencies. The system cannot find the file specified."

It seems like now that I'm running .NET 4.0, even IIS applications running within another website share web.config files? The last error about UrlRewritingNet.UrlRewriter is something Umbraco uses and is in the Umbraco web.config file.

That being said... how can I get this working? Is there something I can add to the BlogEngine.NET web.config file to make it not try and use the web.config file from Umbraco? I thought the whole point of running an application within a website in IIS was so that you didn't need to worry about web.config files conflicting with one another, and so various .NET software could all be ran on the same domain. But it looks like something has changed with .NET 4.0 and I'm not sure what to do right now. Any help would really be appreciated.

Jan 7, 2011 at 9:35 AM

Well after hours of trying to figure this out, I found I can add the following to my root web.config:

<location path="." inheritInChildApplications="false"> 

I wrapped that tag around the root web.config <system.web> and <system.webserver> and now BlogEngine.NET is working as an application within Umbraco. I just want to make sure what I did is OK right? All I'm telling the web.config file is not to pass on those attributes within my <location> tag to the child application (BlogEngine.NET).

Jan 7, 2011 at 10:13 AM

Yes, that's right.  By adding that, you are keeping Umbraco settings from propagating down to BE.

Jan 7, 2011 at 7:04 PM

Thanks Ben,

I think it's safe to say then that this isn't a .NET 4.0 issue. My previous install of BlogEngine.NET into an existing .NET website worked because the root web.config file of that web sitedidn't conflict with BlogEngine.NET's web.config file.