在 ASP.NET MVC 5 Mono 中使用 Razor Url 帮助程序时找不到方法“RouteCollection.get_AppendTrailingSlash" [英] Method 'RouteCollection.get_AppendTrailingSlash' not found when using Razor Url helpers in ASP.NET MVC 5 Mono

查看:25
本文介绍了在 ASP.NET MVC 5 Mono 中使用 Razor Url 帮助程序时找不到方法“RouteCollection.get_AppendTrailingSlash"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 ASP.NET MVC 5 中创建一个 Mono(Ubuntu 14.4、Monodevelop 5.9、Mono JIT 编译器版本 4.0.1).

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

当我添加这个

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

我收到此错误:

System.MissingMethodException

System.MissingMethodException

找不到方法RouteCollection.get_AppendTrailingSlash".

Method 'RouteCollection.get_AppendTrailingSlash' not found.

System.Web.Mvc 从包中引用.还有什么需要的吗?

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

更新:到目前为止,我尝试了这些解决方案:

Update: I tried these solutions so far:

mono下是否可以使用Razor 2.0视图引擎?

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/

这似乎是一个 已知问题 但是我坚信应该有一些技巧可以使它起作用.我也尝试使用 aspx 引擎,但没有任何收获.

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.

推荐答案

最新消息 afaik 是 Miguel 拒绝了我的 去年最小的拉取请求,但您可以在该拉取请求的底部看到其他几个人已经在 github 上构建了包括这个和更多内容.

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.

我看不到有人接受单声道主线的拉取请求.我能看到的前进方向是,如果您知道/可以说服 Xamarin 团队中的某个人推动这一点.

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.

或者,帮助让现在开源的 .Net 代码在单声道上运行.

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

但是 https://github.com/gentoo/dotnet 看起来很有趣:它已经拉了这个并且其他一些 MVC5 更改.

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

这篇关于在 ASP.NET MVC 5 Mono 中使用 Razor Url 帮助程序时找不到方法“RouteCollection.get_AppendTrailingSlash"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆