[Mono-list] MVC hosting

Robert Jordan robertj at gmx.net
Mon May 9 11:17:20 EDT 2011


On 09.05.2011 17:12, Doug wrote:
> May I ask what your apache config looks like?
>
> I don't have any problem serving a default.aspx page using mod_mono (ie.
> default.aspx, with a default.aspx.cs code behind file), but like I said,
> when I drop my Global.asax (and all the other mvc application files) into
> the folder it just tries to serve them directly; ie. /Home/Test returns a
> 404, not the test view that I expect. /Global.asax returns an error.
>
> Ie. apache seems to be serving the actual files, and ignoring the routing
> info that was defined in Global.asax.cs (now compiled and in
> bin/MvcHelloWorld.dll).

You must disable AutoConfiguration:


http://www.mono-project.com/AutoHosting#ASP.NET_MVC_and_AutoConfiguration

http://www.mono-project.com/AutoHosting

MonoAutoApplication disabled

Robert


>
> ~
> Doug.
>
> On Mon, May 9, 2011 at 11:00 PM, Abe Gillespie<abe.gillespie at gmail.com>wrote:
>
>> I'm happily running an MVC2 site publicly on Mono / Apache.  I assure you
>> it works.
>>
>> Simply go through the setup steps for a WebForms site and then point it at
>> your MVC site.
>>
>>
>> On Mon, May 9, 2011 at 10:13 AM, Doug<douglas.linder at gmail.com>  wrote:
>>
>>> There are indeed, many websites about running mvc via xsp2.
>>>
>>> Most of them suggest (as a first step) seeing the example in
>>> /usr/share/asp.net2-demos/ to see how to do this.
>>>
>>> *The problem is that these examples are not MVC applications. *
>>>
>>> They are just aspx files. And that seems to be all xsp can handle...
>>>
>>> Indeed, if you jump into the source archive for xsp2, that's all you'll
>>> find there too in the tests folder.
>>>
>>> Am I wrong? If someone can show me what I'm doing wrong I'm happy to admit
>>> that.
>>>
>>> No matter how hard I look at it though, mod_mono and xsp (ie. the fast cgi
>>> impl) only seem to be able to handle code-behind files, not wsgi style web
>>> apps.
>>>
>>> ~
>>> Doug.
>>>
>>>
>>> On Mon, May 9, 2011 at 9:59 PM, Abe Gillespie<abe.gillespie at gmail.com>wrote:
>>>
>>>> Mono runs ASP.Net MVC apps just fine.  The sources are here:
>>>>
>>>> http://ftp.novell.com/pub/mono/sources/
>>>>
>>>> XSP is at the very bottom.  Note that you'll probably want mod_mono as
>>>> well if you're running your site through Apache.  Setup and running XSP /
>>>> mod_mono is very Googlable; see what you can turn up.
>>>>
>>>> Note, that if you compiled MonoDevelop from source, there may be some
>>>> extra steps involved to point MD at XSP and have it run / debug your MVC
>>>> sites properly.  I don't know, I never compile MD from source.
>>>>
>>>> -Abe
>>>>
>>>> On Mon, May 9, 2011 at 4:00 AM, Doug<douglas.linder at gmail.com>  wrote:
>>>>
>>>>> Hi there,
>>>>>
>>>>> I'm posting this here in the hopes the mono-list is slightly more
>>>>> populated that the asp sublist.
>>>>>
>>>>> Basically the issue I have is this:
>>>>>
>>>>> I can compile an MVC 2.0 application under mono (great) but I can't
>>>>> actually run it.
>>>>>
>>>>> xsp2 appears to only serve old-style apps where there is a 1-1 mapping
>>>>> between the file system and files, with each .aspx file having an associated
>>>>> .aspx.cs code-behind file. This is not how MVC apps work.
>>>>>
>>>>> MVC apps should have their urls parsed and run according to the routing
>>>>> information defined for that application; typically the
>>>>> /{controller}/{action} url is mapped to the function {action} in the class
>>>>> Controller{controller} in the project. Under no circumstances should the
>>>>> webserver randomly start trying to load aspx files from purely from the url
>>>>> pattern.
>>>>>
>>>>> I've seen a few vague posts about something called 'xsp4' that is
>>>>> somehow capable of doing this (for example this page mentions it with regard
>>>>> to using razor:
>>>>> http://twistedcode.net/blog/post/2011/02/03/Orchard-begins-to-work-under-Mono.aspx),
>>>>> and is possibly packaged as part of the mono develop package, but I can't
>>>>> find any concrete information on where to actually get this.
>>>>>
>>>>> Also, if it's part of mono develop, that's not particularly useful for,
>>>>> for example, actually hosting a web app that uses MVC on a real server.
>>>>>
>>>>> Is this part of the git repo somewhere?
>>>>>
>>>>> I build mono 2.10 from source on my server, but I couldn't find the
>>>>> sources to xsp anywhere.
>>>>>
>>>>> help~
>>>>>
>>>>> cheers,
>>>>> Doug.
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Mono-list maillist  -  Mono-list at lists.ximian.com
>>>>> http://lists.ximian.com/mailman/listinfo/mono-list
>>>>>
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> Mono-list maillist  -  Mono-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-list
>>>
>>>
>>
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list




More information about the Mono-list mailing list