Getting RC2 running on ASP.Net 4 (and another web app)

Topics: ASP.NET 2.0
Dec 11, 2010 at 7:31 PM

Greeting all,

I'm trying to get the RC2.0 release running on shared hosting with .Net 4.0. I could really use some help. Here is the situation:

* I've set up BlogEngine to run as a web app in a virtual directory, running ASP.Net 4 with Classic Pipeline.  

* My web host supports either ASP.Net 2.0 or ASP.Net 4.0, but not ASP.Net 3.5. Both can run either Integrated Pipeline or Classic Pipeline.

* I also have a separate application (Umbraco) running in my root directory. Umbraco is a .Net CMS which runs my website. I'd like to continue using it for everything but the blog, and use BlogEngine for the blog. Umbraco runs on ASP.Net 4.0 with Classic Pipeline. I would like Umbraco and BlogEngine to co-exist if at all possible.

Here is what I've done:

* I've commented out the entire duplicate SectionGroup section in the RC2 web.config, per other posts on getting RC2 to work on .Net 4.  

* Next I was getting an ASP compiler version error so I had to update the compiler version number in two places:

      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v4.0" />
        <providerOption name="WarnAsError" value="false" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v4.0" />
        <providerOption name="OptionInfer" value="true" />
        <providerOption name="WarnAsError" value="false" />

* Then I had to comment out a duplicate scriptModule section. I commented out the following line (hopefully that was the correct one):

<!--      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> -->

This got me pretty far. Unfortunately, when I try to navigate to the BlogEngine URL I set up for the virtual directory, I get an ASP error:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'UrlRewritingNet.UrlRewriter' or one of its dependencies. The system cannot find the file specified. (C:mywebhostaddress\wwwroot\web.config line 76)

Source Error:

Line 74:     <httpModules>
Line 75:       <!-- URL REWRTIER -->
Line 76:       <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
Line 77:       <add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
Line 78:       <!-- UMBRACO -->

It appears to be reading the web.config for Umbraco (in my wwwroot) rather than the web.config for BlogEngine, even though I am browsing to the URL set up for my virtual directory that points to BlogEngine.

I don't know enough about ASP.Net to trouble-shoot further, or if this is a hosting problem rather than a BlogEngine/ASP.Net setup issue. I would appreciate any ideas you might have.



Dec 11, 2010 at 8:34 PM

The root application Umbraco's settings are propagating down to the child application (BE).  See this post.  You want to edit the Umbraco web.config file (not BE), and add those <location> tags shown in bold.  This will prevent the Umbraco settings from propagating down to BE.

ASP.NET 3.5 is the same as ASP.NET 2.0 for the application pool.  There is no ASP.NET 3.5 application pool.  For ASP.NET 3.5 applications, you want to use the ASP.NET 2.0 application pool.  BE 2.0 can be used with ASP.NET 4.0 too, if you make the necessary adjustments to the web.config file.  I think we'll include an ASP.NET 4.0 web.config file with the final release of BE 2.0 ... for people who want to run BE under ASP.NET 4.0.

Anyhow, try adding those <location> tags.  That *should* get you past the error you're currently seeing.

Dec 12, 2010 at 9:46 PM

I've just been trying to get BE 2.0 to run on my GoDaddy hosting; and kept getting a server error 500.

It seems that there are issues when trying to run BE 2.0 in an app pool that's 4.0, unfortunately for me I have another app on that hosting that only runs in 4.0 - so I can't drop it down to 2.0 / 3.5.
Locally I've been testing BE 2.0 and IIS just happens to be set up with ASP.NET 2.0 as the default for app pools, so it's just worked for me. It was only after deleting my site and uploading the new version
that I found out about the issues - so have had to delete the new version and re-upload the original (thankfully I made a copy as it said in the upgrade documentation!)

However it would be really awesome if you do include a web.config file for 4.0 - or in the meantime some guidance on how to approach it.

Dec 12, 2010 at 9:50 PM

There is now (as of yesterday) an ASP.NET 4.0 web.config file in the latest builds.  It's in the /setup folder.  Here's a direct link.

Dec 12, 2010 at 11:35 PM

Hi Ben,

First, thanks so much for explaining how the web.config settings cascade from the root app down to other .net apps in subfolders-- I didn't know that.  Second, thanks for building a .Net 4 web.config.

Unfortunately it isn't working for me.  Here is the error below.  Any ideas?



Server Error in '/blogtest' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\blogtest\6aefc8b9\c98cbe8f\App_global.asax.lyhtrwmo.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\blogtest\6aefc8b9\c98cbe8f\assembly\dl3\dfe3bc84\00b2f760_1e46cb01\App_global.asax.DLL'

Source Error:

[No relevant source lines]

Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\blogtest\6aefc8b9\c98cbe8f\App_Web_postlist.ascx.f2f6c41d.shsb-a4s.0.cs    Line: 50 

Dec 13, 2010 at 4:22 AM

I *think* you're heading in the right direction.  Do you get this error when pulling up Umbraco too, or just when pulling up BE ?

Somebody recently had this type of error recently, where something "exists in both" place A and place B.  It was this discussion.  This error message comes up in Google searches too, with this and this search.  Some of the search results may help you.  The person in the other discussion ended up solving this by deleting everything and re-uploading.  That's not always the solution.

When you deploy the BE files to the server, are you just copying/FTPing them?  That's the suggested and proven method.  If you try to precompile or publish BE where you end up with many .DLL files in the /bin directory, that can cause problems ... probably not this particular problem, but just a general warning.

You could try restarting the blog, by making a change to the web.config file (add a space).  That may or may not help.

I hope that other discussion here or some of the Google search results help out.  If not, feel free to post back here.

Dec 13, 2010 at 7:19 PM

Excellent - Thanks Ben,

That works locally for me when I use ASP.NET v4.0 (integrated), not for Classic.
I've just pushed the changes up to GoDaddy, but still have an issue there - I guess they're running in classic pipeline mode so I have opened a support ticket with them to find out what's going on and
why I'm getting an error. I think my hosting with them is due for renewal in Feburary... we'll see whether I renew or take out hosting with Amazon

Dec 13, 2010 at 7:53 PM


I deleted my BlogEngine deployment, and re-deployed using the new ASP.Net 4 web.config.  This solved the "type 'ASP.global_asax' exists" problem and it appears that BlogEngine is working for me OK now.

Thanks for your help,