BE 2.0 Saving settings on mono+mysql doesn't work

Feb 20, 2011 at 2:53 PM

I am trying to get BE 2.0 to work on mono. The blog look to run fine, but I cannot save settings. I'm able to add new users.

I'm using Mono (tried both 2.8.2 and 2.10), Mysql. And using the guide that's over here :

Before someone will tell me to check that the web app has the correct rights to write in App_Data. I have tried that, and then I resorted to using MySql to "bypass" that problem.

To me it seems that the problems lie in javascript/ajax. When I press the submit button, server side it doesn't trigger the "public static JsonResponse Save(...)" method. It goes into the OnInit, but the Save method doesn't get called.

When I compare the response/request when pressing the save button between Chrome/Windows/.NET3.5 and Chromo/OpenSuse/Mono2.10 the traphic is different. On Mono it doesn't look like an Ajax/jQuery call, just a normal postback.

In order to avoid to unneccesarily dive deeper into the code, can someone give me a hint what might be wrong. Or better yet, does someone have a working peace of code/binary for Mono?

Feb 21, 2011 at 2:11 AM

There is a fork you can use to run BE 2.0 on Mono, read (a little) more here.

Feb 21, 2011 at 7:16 AM

I have done that before. And I tried it again just now. And the result is that in Monodevelop (2.4.2) something goes wrong with loading the project files. Some files end up in the correct folders, but a lot are shown directly beneath the project root.

Everything builds just fine, but when I run the app, it cannot find the start page. If I check out the physical path of the web app, I see that I have a Default.aspx.cs.designer but no Default.aspx.

I don't know that MonoDevelop does, but in Visual Studio it opens just fine.

Feb 21, 2011 at 1:43 PM

The download in the fork contains two folders BlogEngine.Net and BlogEngine.NET. MonoDevelop doesn't like the fact that the files are in seperate directories. So I merged the folders. And fixed the csproj file (replace BlogEngine.NET with BlogEngine.Net). This seems to help. I can build an run the application.


But I'm back to my original problem. Cannot save settings unless I modify the admin/Settings/main.aspx file, buy remarking the "if ($(frm).valid())" line. Than saving of the settings works.


Next problem, saving comments. When trying to save comments, it just hangs. And nothing is being saved.

Feb 28, 2011 at 1:33 PM


Just to try Mono 2.8 (and later 2.10... then 2.10.1) I did some work to turn BE into a web app in order to work on it inside MonoDevelop and get everything working and built under Mono and Linux. This is as far as I went

As you comment, there is something going bad with settings save. That is pretty much the only thing missing from the set of functionalities I use on BE. As for the comments, they seem to be working fine to me.

There were other issues too, like widgets loosing settings or part of their settings (e.g. Twitter widget). No one else reported that, so probably that is just a problem with my environment. That turned out to be a difference between Mono XmlReader and MS XmlReader.

Please, let me know if you find the (correct) solution for the save settings problem. Meanwhile, please check if the comments work better on the version I am using and also, do not forget about MONO_IOMAP.



Feb 28, 2011 at 7:34 PM

I used disqus comments as a work around. But I'm gonna do more thorough testing tomorrow.

By the way, the twitter widget doesn't work for me too.

Mar 1, 2011 at 2:34 PM

Turned out the problem with the settings was caused by mono not rendering the form tag in the exact same way ms asp .net does when using  master child pages. It blows away jquery validator. I added a (I will burn in hell) workaround to the version I am still trying to get to work completely.

I have used enough time so I think everything is left is a nice post on porting to Mono. Here it is in its full glory:

Hope it helps you.



BTW: I introduced again the RedirectMode attribute in the web.config since it was implemented recently. Maybe someone should take a look to see if all of the mono workarounds are still needed.