Running dasBlog against ASP.NET 4.0

Topics: Support Request
Oct 21, 2010 at 12:48 PM

What is the status of support for running dasBlog in an environment with ASP.NET 4.0 (no ASP.NET 2.0/3.5)?

A Google/Bing search for "dasblog ASP.NET 4" (without quotes) doesn't bring up the answers I'm looking for.

Is anyone doing it successfully?  Does it require a recompile from source?  Does it require config/source/other modifications?

If this is breaking new ground, I'll probably just have to muddle through it, but I thought I'd check first to see if anyone else has made an attempt?

Thanks in advance.

Coordinator
Oct 21, 2010 at 4:14 PM
I'm working on that scenario (among others).
 
The easiest to get going right now, is to grab the current sources from the trunk and convert, compile for .Net 4. You will get some warnings, but it will work fine.
 
In a couple of months I hope to have more stable release with some new features.
 
You can also have a look at the dasblog2010 branch for the latest unstable work.
Nov 19, 2010 at 4:24 PM

I'm finally getting back to this.

I grabbed the DasBlog trunk and attempted to up-convert "trunk\source\DasBlog-2008.sln" from VS2008 to VS2010.

The "newtelligence.DasBlog.Web" project fails (somewhat silently) to convert.

Using the project file in the dasblog2010 branch as a guide, I replaced:

  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" Condition=" '$(Solutions.VSVersion)' == '8.0'" />  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" Condition=" '$(Solutions.VSVersion)' == '9.0'" />

With:

  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

And then reloaded the project.  The conversion succeeded after this change.

A build and F5 run showed a default DasBlog web page (success!).

I'll continue to test for .NET 4 specific issues.  Thanks!

Coordinator
Nov 19, 2010 at 4:40 PM
Good to hear...
I'm still slowely working on new features, but they currently depend on the SQL CE Ctp, so they're not ready for prime time yet.
With the long weekend, I might have some time to get something checked in.
Dec 5, 2010 at 9:16 PM
Edited Dec 5, 2010 at 9:17 PM

Any news on this? I recently migrated a couple of dasblog blogs from Windows 2003 Server using .NET 2.0 to Windows 2008 Server R2 using .NET 4.0 and now cannot post to either of them. They display fine, but posting from the page on the site gives the potentially dangerous request error, which I can't seem to get around, and trying to post from Window Live Writer (which is what I normally do) gives an error that it can't find a file called blogger.aspx.

I'd be very interested to hear if there is a new version of dasblog that works on .NET 4.0, without me having to download the source and compile it.

Thanks

Dec 5, 2010 at 9:43 PM

I have the .NET 2.0 version of DasBlog running on a .NET 4.0 server.  I had to edit some files (like web.config) to get posting to work on the remote server, but I had trouble reproducing those problems on a local server.  I don't use Windows Live Writer, so I can't help you there.  My blog is functional, but there are multiple issues I've noted to go back and investigate further when I have more time (which may be never).  My hosting provider hasn't been terribly helpful and I can't easily replicate the hosting environment locally, but doing so would help me understand a lot better what is going wrong.

I believe I was getting the "potentially dangerous request error" at one point and I believe the change to get that to go away (note: it feels like a hack to me) was to set page validation back to the .NET 2.0 style in the web.config.  I apologize for not looking up the exact change I made.

Dec 6, 2010 at 9:13 AM
Edited Dec 6, 2010 at 9:13 AM

Hi Michael,

MichaelPMaddox wrote:

I have the .NET 2.0 version of DasBlog running on a .NET 4.0 server.  I had to edit some files (like web.config) to get posting to work on the remote server, but I had trouble reproducing those problems on a local server.  I don't use Windows Live Writer, so I can't help you there.  My blog is functional, but there are multiple issues I've noted to go back and investigate further when I have more time (which may be never).  My hosting provider hasn't been terribly helpful and I can't easily replicate the hosting environment locally, but doing so would help me understand a lot better what is going wrong.

I have my own server (so can do what I like!), which is running Windows 2008 Server Web edition 64bit. I set up a web site for a blog using the default application pool, which is running v4 of the framework. The blog displayed fine, but I can't post to it at all.

I tried changing the site to use a different application pool running v2, but it gave a few weird (to me) errors just trying to view the blog. I gave up with that idea and went back to a v4 app pool, so at least the blog was visible.

MichaelPMaddox wrote:

I believe I was getting the "potentially dangerous request error" at one point and I believe the change to get that to go away (note: it feels like a hack to me) was to set page validation back to the .NET 2.0 style in the web.config.  I apologize for not looking up the exact change I made.

I tried those hacks (I agree by the way), but it didn't help. I still got the warning and couldn't post.

So where do I go from here? I've been using dasblog for years and am happy with with it, but given that .NET 4.0 is very much here, and dasblog doesn't seem to work properly with it, I'm not sure if it's worth continuing with it. I don't have the time or incilination to start tinkering with the source code. One of the big attractions of dasblog for me has always been that i could just drop the files onto a web site and it worked. Never needed a database or fancy configuration. If I'm going to have to start tinkering, I might as well just change blog platform (which I really don't want to do).

Surely this must have been an obvious issue. Plenty of people run .NET 4.0, not just you and I. How come dasblog hasn't been updated to fix this problem?

Thanks for the reply. I would be interested to hear what you have to say.

Dec 15, 2010 at 4:38 PM

Hi,

I have dasBlog running on DiscountASP with .NET 4.0 (classic pipeline). I am running the dasblog2010 fork rev 50784 (that's v2.4.251.0). The only changes I had to make to web.config to get rid of the "Potentially dangerous request" problem were:

  1. <httpRuntime useFullyQualifiedRedirectUrl="true" requestValidationMode="2.0"/>
  2. <pages validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

This resolved the problem for me. I hope this helps.

-- Ragesh.

Dec 15, 2010 at 9:10 PM
Edited Dec 15, 2010 at 9:16 PM

Hi Ragesh,

Thanks for the reply, I was beginning to think no-one was going to notice my question!

I tried those settings, although I think I was using the integrated pipeline not classic, so maybe that's worth trying.

However, your comment about the version intrigues me. I just clicked the Download link at the top of this page, and it shows the latest version as 2.3.9074.18820, not 2.4.251.0 as you mentioned. Where did you get this version?

Thanks

P.S. Just tried changing the application pool of the site running dasBlog to "Classic .NET AppPool" which uses v4.0 of the framework and Classic pipeline, but then I got an error of...

"HTTP Error 404.2 - Not Found
The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server."

...when I tried to view a page.

Apparently this means that an ISAPI module is not installed or not allowed, but as I have no idea which module gave the error, I have no way of knowing what it was.

Any ideas? Thanks again

Dec 16, 2010 at 4:26 AM

Hi,

I didn't use the release version from the downloads. Instead, I downloaded and compiled the code straight from the SVN repository.

Now that you mention it, I also had the ISAPI/CGI restrictions problem. In my case, it was because I hadn't installed ASP.NET feature in IIS. I had to go into Programs & Features --> Windows components --> IIS and explicitly enable ASP.NET. If it still fails to work after this, you may want to try running aspnet_regiis /i to re-register everything. This got everything running perfectly on my Win7 machine.

Let me know how it goes!

-- Ragesh.

Dec 16, 2010 at 9:46 PM

Hello again Ragesh,

Thanks for the suggestion, but it didn't work. I already had ASP.NET installed, and I tried re-registering .NET4 with IIS, but it didn't make any difference. When I use the default app pool (.NET v4, integrated pipeline), dasBlog works OK, but if I change it to the Classic .NET AppPool (.NET v4, classic pipeline), I get the ISAPI error.

The annoying thing is that IIS doesn't give you any information about WHAT restriction caused the error. Not very helpful.

I'm getting to the stage where I'm thinking of dumping dasBlog and looking for another blog engine. It's a shame, as I've been using it for years, and am happy with it. I just don't have the time to mess around finding out what will work. I want something that will just work out of the box. After all, I'm not running any weird system here. It's a bog standard out-of-the-box set up.

Thanks again for your help. If you ahve any more ideas, please feel free to suggest. In the meantime, I'll have to go hunting for something else.

Developer
Dec 17, 2010 at 3:03 AM

Check "ISAPI and CGI Restrictions" in the IIS Management Console and make sure asp.net 4.0 is set to allow.

Coordinator
Dec 17, 2010 at 3:04 AM
Does installing DasBlog via WebPI set all these prerequisites up?
>
Dec 19, 2010 at 1:19 PM
tonyb wrote:

Check "ISAPI and CGI Restrictions" in the IIS Management Console and make sure asp.net 4.0 is set to allow.

Thanks for the suggestion, but the server is running quite a few web sites already, and they all use .NET 4.0. I don't have anything running earlier versions.

Any other ideas?

Dec 19, 2010 at 2:27 PM

Don't mean to be rude Scott, but do you ever sleep? Seems like wherever I go on the web these days, your name pops up!

Anyway, I'm glad you popped up here, because I think you might have solved my problem. I just tried installing a new dasBlog site via WebPI, and it went in like a dream. I can use Windows Live Writer as well.

Now, is there any way to pull out the relevant settings from the test site I just installed, and copy those over to the two existing dasBlog sites I have on the server? That would be easier than deleting those sites, installing from scratch and then having to copy all the content back in.

Thanks again

Dec 19, 2010 at 3:15 PM

Just to follow up my own post, I found it was easier than I had feared...

I stopped the dasBlog site, and renamed the folder to something else. I created a new folder and used WebPI to install dasBlog there. It took care of all the details for me. Restarting the site now showed the new (empty) blog.

I then manually copied the contents of the content folder from the old site to the new one, and that was it! I had to touch the web.config file to force dasBlog to refresh the content, but that wasn't a problem.

My only problem now is that it won't let me log in! This isn't a huge problem as I can post from Live Writer, and I am happy modifying the settings by editing the files, but it's annoying.

The only thing I can think of is that when I chose a user name (in WebPI), I used a mixed case name. When I try to log in to the blog from the login.aspx page, if I enter the mixed-case user name, it converts it to lower case. It won't let me log in, it just returns to the login page.

Any ideas? Thanks again

Dec 19, 2010 at 5:40 PM

OK, spoke too soon. Didn't all go as smoothly as I thought.

I did the same to my other dasBlog site, and it looked fine until I tried to use Live Writer with it. I deleted the existing account for the blog, as I found trying to use it caused problems, and figured I would be better deleting it and adding it again.

When I tried to add it back, I got an error saying that it couldn't find blogger.aspx, which is where I was before.

So, I'm still not out of the woods. Any ideas?

Thanks again

Dec 19, 2010 at 8:00 PM

Hee hee, this is getting like a monologue!

Anyway, in case it helps anyone, I sorted it out. Installing via WebPI worked fine, and created a new application pool for each site (not something I like). I changed the app pool to the default, and that's when it stopped working.

So, you need to install via WebPI, and then either accept the app pool it creates for you, or (like I did), set up an app pool that uses v2 of the .NET framework and integrated pipeline, and have your dasBlog blogs use that. The point being that dasBlog does NOT work with v4 of the .NET framework. I have no idea why, maybe some of the developers might be able to chip in.

Anyway, at least I can carry on without wasting any more time trying to work out how to get it to work!

Hope this monologue was useful to someone.

Feb 23, 2011 at 8:41 PM

Any updates about a new stable release that is native .NET 4?  Looks like some work as been done from the recent changesets.  How stable is the dasBlog2010 branch?

Thanks for the help!

Apr 4, 2012 at 2:24 PM

See the solution that worked for me at http://dasblog.codeplex.com/discussions/291818

Feb 3 at 10:20 PM

I was running on 4.0 with a precondition of runtimeVersion2.0

Just removed:

preCondition="integratedMode,runtimeVersionv2.0"

from all the handlers and it worked.

Thanks.

Nov 14, 2012 at 1:24 PM

Check this: http://creatorul.net/blog/2012/11/14/RunningDasBlogOnASPNET40Hosting.aspx