[Mono-list] asp.net mvc ArgumentNullException

Daniel Lo Nigro lists at dan.cx
Wed Dec 19 10:03:15 UTC 2012


gmcs is the .NET 2.0 compiler; you should be using dmcs for .NET 4.0.


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

> 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
> /out:"/tmp/www-data-temp-aspnet-0/a4fd38ea/App_global.asax_489db983.dll"
> /r:"/usr/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll"
> /r:"/usr/lib/mono/gac/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll"
> /r:"/usr/lib/mono/gac/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll"
> /r:"/usr/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll"
> /r:"/usr/lib/mono/gac/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll"
> /r:"/usr/lib/mono/gac/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll"
> /r:"/usr/lib/mono/gac/System.Runtime.Serialization/3.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll"
> /r:"/usr/lib/mono/gac/System.IdentityModel/3.0.0.0__b77a5c561934e089/System.IdentityModel.dll"
> /r:"/usr/lib/mono/gac/System.ServiceModel/3.0.0.0__b77a5c561934e089/System.ServiceModel.dll"
> /r:"/usr/lib/mono/gac/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll"
> /r:"/usr/lib/mono/gac/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll"
> /r:"/usr/lib/mono/gac/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll"
> /r:"/usr/lib/mono/gac/System.Web.Routing/3.5.0.0__31bf3856ad364e35/System.Web.Routing.dll"
> /r:"/usr/lib/mono/gac/System.Web.Extensions/4.0.0.0__31bf3856ad364e35/System.Web.Extensions.dll"
> /r:"/usr/lib/mono/gac/System.Web.Abstractions/3.5.0.0__31bf3856ad364e35/System.Web.Abstractions.dll"
> /r:"/usr/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll"
> /r:"/var/www/TestApp/bin/System.Web.Mvc.dll"
> /r:"/var/www/TestApp/bin/TestProject.dll"  /nowarn:0169  --
> "/tmp/www-data-temp-aspnet-0/a4fd38ea/App_global.asax_489db983_0.cs"
>
>
> Unhandled Exception: Mono.CSharp.InternalErrorException:
> /tmp/www-data-temp-aspnet-0/a4fd38ea/App_global.asax_489db983_0.cs(36,18):
> ASP.global_asax ---> Mono.CSharp.InternalErrorException:
> /tmp/www-data-temp-aspnet-0/a4fd38ea/App_global.asax_489db983_0.cs(38,29):
> 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.
>>>
>>
>>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20121219/c87c97e0/attachment-0001.html>


More information about the Mono-list mailing list