Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method 'RouteCollection.get_AppendTrailingSlash' not found when using Razor Url helpers in ASP.NET MVC 5 Mono

I am creating an ASP.NET MVC 5 application in Mono (Ubuntu 14.4, Monodevelop 5.9, Mono JIT compiler version 4.0.1).

I see that some of the razor components are not recognized, eg:

@Url.Action

When I add this

<a title="Notifications" href="@Url.Action("_Listing","Home")"> Home </a>

I get this error:

System.MissingMethodException

Method 'RouteCollection.get_AppendTrailingSlash' not found.

System.Web.Mvc is referenced from the packages. Is there anything else which is required?

Update: I tried these solutions so far:

  • Does the Razor View Engine work for Mono?

  • Is it possible to use Razor 2.0 view engine under mono?

  • http://www.davidloo.com/?p=479

  • http://iws.io/walkthrough-porting-asp-net-mvc-website-to-mono-2-6-1-and-mysql-on-linux-apache-porting-to-mono-part-3-of-3/

It seems like it is a known issue but I strongly believe there shall be some hack for this to work. I tried using aspx engine also but no gain.

like image 521
xameeramir Avatar asked May 28 '15 05:05

xameeramir


1 Answers

The latest news afaik is that Miguel rejected my minimal pull request last year but you can see at the bottom of that Pull Request that a couple of others have got builds on github which include this and more.

I can't see anyone's got a pull request accepted for mono mainline. The way forward I can see is if you know/can persuade someone on the Xamarin team to push this.

Or, helping with getting the now-open-sourced .Net code running on mono.

But https://github.com/gentoo/dotnet looks interesting: It has pulled this and some other MVC5 changes.

like image 129
Chris F Carroll Avatar answered Sep 21 '22 10:09

Chris F Carroll