[Mono-list] Serving cshtml files as parsed.

Fernando Rodriguez frodriguez.developer at outlook.com
Mon Sep 29 19:24:18 UTC 2014


See this zip file: 
https://drive.google.com/file/d/0BzPt9N2PyrQGdXA1MUxkdWZ5dzA/view?usp=sharing. 
Just unzip it, cd to it and run xsp4 then go to 
localhost:8080/index.cshtml. It should work, then you can figure out what 
you're missing from it.

Probably mono can't find the assembly you referenced on the handler, the MVC 
assembly on this sample is 4.0.0.0 from MS and the rest are 3.0.0.0 from mono. 


> So make sure all the references on the Web.config are to the right version on 
> your bin directory.
> 
> On Monday 29 September 2014 6:50:03 PM Martin Thwaites wrote:
> > Nope, that didn't help.
> > 
> > It seems that "physical" files are overriding the handlers.
> > 
> > Any further suggestions anyone?
> > 
> > Thanks
> > Martin
> > On 29 Sep 2014 08:19, "Martin Thwaites" <monoforum at my2cents.co.uk> wrote:
> > 
> > > I think the handler's missing so I'll try that tonight.  Don't know why 
it
> > > would work on windows without it though.
> > >
> > > Thanks
> > > Martin
> > > On 29 Sep 2014 04:41, "Fernando Rodriguez" <
> > > frodriguez.developer at outlook.com> wrote:
> > >
> > >> You still need those assemblies on your bin. They're used to process 
the
> > >> cshtml files. On Windows it probably uses the ones in the GAC but at
> > >> least for
> > >> me it doesn't in mono.
> > >>
> > >> You'll need the following a handler on your Web.config, I tried the
> > >> following:
> > >>
> > >>       <add verb="*" path="*.cshtml" validate="false"
> > >> type="System.Web.Mvc.MvcHttpHandler,
> > >> System.Web.Mvc, Version=4.0.0.0, Culture=neutral,
> > >> PublicKeyToken=31BF3856AD364E35" />
> > >>
> > >> I assume you got that since it works on Windows but make sure the 
version
> > >> matches the assembly that you put on your bin directory.. I used the 
one
> > >> that
> > >> comes with MS MVC4. You may have a different handler on your web.config,
> > >> just
> > >> make sure that whatever it's assembly is you copy it to your bin.
> > >>
> > >> Also all the System.Web.WebPages.* from your mono GAC need to be copied 
> to
> > >> your bin dir.
> > >>
> > >> Once you got that it should compile and serve your cshtml files.
> > >>
> > >>
> > >> On Sunday 28 September 2014 10:29:37 PM Martin Thwaites wrote:
> > >> > Thanks Fernando, couple of things I forgot to add...
> > >> >
> > >> > It's running through XSP in debug through MonoDevelop.  Secondly, 
it's
> > >> not
> > >> > MVC that I'm trying to run.  It's a static cshtml that's self 
> contained.
> > >> >
> > >> > i.e. admin/index.cshtml, I need it to be processed and served.
> > >> >
> > >> > Thanks,
> > >> > Martin
> > >> >
> > >> > On 28 September 2014 22:12, Fernando Rodriguez <
> > >> > frodriguez.developer at outlook.com> wrote:
> > >> >
> > >> > > On Sunday 28 September 2014 9:47:53 PM Martin Thwaites wrote:
> > >> > > > I'm trying to run a solution on mono that uses cshtml files 
without
> > >> using
> > >> > > > MVC.
> > >> > > >
> > >> > > > On Windows, the files are parsed and served, however, on mono it's
> > >> > > throwing
> > >> > > > them back as if they are static files.
> > >> > > >
> > >> > > > I'm sure I'm missing something obvious, but just can't get my 
head
> > >> around
> > >> > > > it.
> > >> > > >
> > >> > > > Anyone got any advice?
> > >> > > >
> > >> > > > Thanks,
> > >> > > > Martin
> > >> > >
> > >> > > Did you configure the web server to handle .cshtml files by mono?
> > >> > >
> > >> > > Also to get MVC4 working on mono (I could never get MVC5 working)  
I
> > >> had
> > >> to
> > >> > > copy all the System.Web.WebPages.* and Razor assemblies to my bin
> > >> > > directory so
> > >> > > you may need to do the same.
> > >> > >
> > >> > >
> > >> > > ----------
> > >> > > Fernando Rodriguez
> > >> > > frodriguez.developer at outlook.com
> > >> > > _______________________________________________
> > >> > > Mono-list maillist  -  Mono-list at lists.ximian.com
> > >> > > http://lists.ximian.com/mailman/listinfo/mono-list
> > >> > >
> > >>
> > >> --
> > >> ----------
> > >> Fernando Rodriguez
> > >> frodriguez.developer at outlook.com
> > >> _______________________________________________
> > >> Mono-list maillist  -  Mono-list at lists.ximian.com
> > >> http://lists.ximian.com/mailman/listinfo/mono-list
> > >>
> > >
> 
> 

-- 
----------
Fernando Rodriguez
frodriguez.developer at outlook.com


More information about the Mono-list mailing list