[Mono-list] asp.net mvc ArgumentNullException

Daniel Hughes trampster at gmail.com
Wed Dec 19 09:48:32 UTC 2012

I have scrapped the Auto config options and have managed to get further.
However now I getting an error when trying to access the website,
complaining about a MissingMethodException regarding RegisterRoots, however
RegisterRoots is definitly there (I checked by decompiling with
monodevelop) here is the interesting part of the error:

gmcs /target:library /lib:"/var/www/TestApp/bin" /debug- /optimize+ /warn:4
/r:"/var/www/TestApp/bin/TestProject.dll"  /nowarn:0169  --

Unhandled Exception: Mono.CSharp.InternalErrorException:
ASP.global_asax ---> Mono.CSharp.InternalErrorException:
ASP.global_asax.__initialized ---> System.MissingMethodException: Method
not found: 'TestProject.MvcApplication.RegisterRoutes'.

The interesting thing to me is that gmcs is trying to compile against a
whole lot of .net 2.0 assemblies, but on ubuntu 12.04 we only have .net 4.0
so they are all missing.

How can I tell it to target 4.0, The web.config has 4.0 as the target why
is that not being used?

On Wed, Dec 19, 2012 at 1:37 PM, Daniel Hughes <trampster at gmail.com> wrote:

> The setup I have performed to date is:
> Install the mod_mono packages: libapache2-mod-mono mono-apache-server2
> Install the mono development packages: mono-devel
> Enable the Apache module: a2enmod mod_mono_auto
> sudo apt-get install apache2
> Restart Apache, sudo service apache2 start
> The website was created in monodevelop on ubuntu 12.04 which references
> System.Web.Mvc 1.0 (not 2.0 for some reason) Running from monodevelop works
> fine.
> I have added ForceType application/x-asp-net to the mod-mono config
> I copied the website to /var/www/ and deleted the index.html which was
> there by default
> That's everything I have done, what have I missed or done wrong?
> On Wed, Dec 19, 2012 at 9:28 AM, Daniel Hughes <trampster at gmail.com>wrote:
>> I have an asp.net mvc application which I am trying to get running on
>> ubuntu 12.04 server, with apache and mod mono
>> When I try and access the site I get and Internal Server Error
>> my apache error.log contains the following:
>> Listening on: /tmp/mod_mono_server_global
>> Root directory: /
>> Listening on: /tmp/.mod_mono_server2
>> Root directory: /
>> System.ArgumentNullException: Argument cannot be null.
>> Parameter name: path
>>   at System.IO.FileSystemInfo.CheckPath (System.String path) [0x00000] in
>> <filename unknown>:0
>>   at System.IO.DirectoryInfo..ctor (System.String path, Boolean
>> simpleOriginalPath) [0x00000] in <filename unknown>:0
>>   at System.IO.DirectoryInfo..ctor (System.String path) [0x00000] in
>> <filename unknown>:0
>>   at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:.ctor
>> (string)
>>   at Mono.WebServer.ModMonoWorker.GetOrCreateApplication (System.String
>> vhost, Int32 port, System.String filepath, System.String virt) [0x00000] in
>> <filename unknown>:0
>>   at Mono.WebServer.ModMonoWorker.InnerRun (System.Object state)
>> [0x00000] in <filename unknown>:0
>>   at Mono.WebServer.ModMonoWorker.Run (System.Object state) [0x00000] in
>> <filename unknown>:0
>> [Wed Dec 19 00:01:00 2012] [error] (70014)End of file found: read_data
>> failed
>> I have configured mod mono to use AutoConfiguration with
>> ForceType application/x-asp-net
>> I know this is not recommended but I just want to get something working.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20121219/6980cd2b/attachment.html>

More information about the Mono-list mailing list