[Mono-dev] mod_mono issues on 1.2.6

Joe Audette joe.audette at gmail.com
Mon Dec 17 12:09:53 EST 2007

Hi All,

Saw some of the other posts about problems with mod_mono in 1.2.6
release so thought I would test it with mojoportal since I haven't
tested it in a long time and have only been testing with xsp2.

I'm using opensuse 10.3 with mono 1.2.6
Using mojoportal compiled on windows and packaged for use with mono/mysql
Works fine from the command line using xsp2

Using mod_mono/apache2:

First issue encountered was an invalid param exception thrown from
mscorelib on the setup page. The line of code throwing the exception
is testing for writability in the Data subfolder beneath the site
The code that threw the exception is:

public static void TouchTestFile(String pathToFile)
            if (pathToFile != null)

                if (File.Exists(pathToFile))
                   // exception thrown here from mscorelib
                    File.SetLastWriteTimeUtc(pathToFile, DateTime.Now);
                    StreamWriter streamWriter = File.CreateText(pathToFile);


By deleting the files I was able to get past this as it hit the else clause.

Next error was it could not connect to the database. The cause of this
error is that under mod_mono its not picking up my user.config file
which has the correct connection string. It works fine from the
command line with xsp2.
My connection string is from appSettings section defined in Web.config
to use user.config for overrides like this:
<appSettings file="user.config">

under mod_mono its not picking up my overrides in user.config as it should

so I put the correct connection string directly in Web.config and was
able to get past the db connection problem

Then I'm back to the same problem about setting the write time of
files but this time with cache files. Stack trace below:
System.IO.IOException: Invalid parameter
  at System.IO.File.SetLastWriteTime (System.String path, DateTime
last_write_time) [0x00000]
  at System.IO.File.SetLastWriteTimeUtc (System.String path, DateTime
last_write_time) [0x00000]
  at mojoPortal.Business.WebHelpers.CacheHelper.TouchCacheFile
(System.String pathToCacheFile) [0x00000]
  at mojoPortal.Business.WebHelpers.CacheHelper.TouchMenuCacheDependencyFile
() [0x00000]
  at mojoPortal.Business.WebHelpers.CacheHelper.GetMenuPagesFromCache
() [0x00000]
  at mojoPortal.Business.WebHelpers.CacheHelper.GetMenuPagesFromContext
() [0x00000]
  at mojoPortal.Business.WebHelpers.CacheHelper.GetMenuPages () [0x00000]
  at mojoPortal.Web.mojoSiteMapProvider.BuildSiteMap () [0x00000]
  at mojoPortal.Web.mojoSiteMapProvider.GetRootNodeCore () [0x00000]
  at System.Web.SiteMapProvider.get_RootNode () [0x00000]
  at System.Web.UI.WebControls.SiteMapDataSource.GetStartNode
(System.String viewPath) [0x00000]
  at System.Web.UI.WebControls.SiteMapDataSource.GetHierarchicalView
(System.String viewPath) [0x00000]
  at System.Web.UI.HierarchicalDataSourceControl.System.Web.UI.IHierarchicalDataSource.GetHierarchicalView
(System.String viewPath) [0x00000]
  at System.Web.UI.WebControls.HierarchicalDataBoundControl.GetData
(System.String viewPath) [0x00000]
  at System.Web.UI.WebControls.TreeView.PerformDataBinding () [0x00000]
  at System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect
() [0x00000]
  at System.Web.UI.WebControls.BaseDataBoundControl.DataBind () [0x00000]
  at System.Web.UI.WebControls.TreeView.DataBind () [0x00000]
  at mojoPortal.Web.UI.SiteMenu.RenderTreeView () [0x00000]
  at mojoPortal.Web.UI.SiteMenu.PopulateControls () [0x00000]
  at mojoPortal.Web.UI.SiteMenu.Page_Load (System.Object sender,
System.EventArgs e) [0x00000]
  at System.Web.UI.Control.OnLoad (System.EventArgs e) [0x00000]
  at System.Web.UI.Control.LoadRecursive () [0x00000]
  at System.Web.UI.Control.LoadRecursive () [0x00000]
  at System.Web.UI.Control.LoadRecursive () [0x00000]
  at System.Web.UI.Control.LoadRecursive () [0x00000]
  at System.Web.UI.Control.LoadRecursive () [0x00000]
  at System.Web.UI.Page.InternalProcessRequest () [0x00000]
  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext
context) [0x00000]

So, in short, mojoportal currently does work under xsp2 but not under mod_mono

Now that I am setup for testing mod_mono again I'll be glad to test
any updates for mod_mono. Apologies for not testing mod_mono when I
tested the earlier preview releases of 1.2.6 with mojoportal. I will
move on now to test this issue on a different machine using mono svn
head and see if the problem is also in svn.

Best Regards,


Joe Audette
Software Solutions Architect
Source Tree Solutions, LLC
joe.audette at gmail.com

More information about the Mono-devel-list mailing list