使用.NET MVC 4运行3.2.0单 [英] Running Mono 3.2.0 with .NET MVC 4

查看:128
本文介绍了使用.NET MVC 4运行3.2.0单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得单声道3.0安装程序运行在.NET 4和.NET 4.5 MVC4网站。我一直在努力通过各种错误,我能做些什么来得到它运行起来?

I am trying to get Mono 3.0 setup to run MVC4 sites under .NET 4 and .NET 4.5. I've been working through various errors, what can I do to get it up and running?

服务器配置


  • 的CentOS 5

  • 的Apache 2.2.3

  • 3.2.0(压缩包太阳07月28日0点57分四十零秒UTC 2013年); ASP.NET版本:4.0.30319.17020
    2013年)

  • 从git的最新XSP,由于这个职位的时间

的Apache /单声道配置

MonoServerPath "/usr/local/bin/mod-mono-server4"

在/ usr / local / bin目录/ MOD-单服务器4的内容:

/usr/local/bin/mod-mono-server4 contents:

#!/bin/sh
exec /usr/local/bin/mono $MONO_OPTIONS "/usr/local/lib/mono/4.5/mod-mono-server4.exe" "$@"

更新

问题的关键是,单不MVC4该网站要求发货。它仍然有MVC3 dll文件,但它有剃刀2的dll但没有哪MVC3想要告剃刀1的DLL。

The crux of the problem is that Mono doesn't ship with MVC4 which the site requires. It still has the MVC3 dlls, yet it has the Razor 2 dlls but not the Razor 1 dlls which MVC3 wants to sue.

推荐答案

成功

如果你想运行在Mono MVC4,你需要使用并非由单在这个时候提供了一些微软的DLL。

If you want to run MVC4 on Mono, you need to use some Microsoft dlls which are not provided by Mono at this time.

提醒一句 - 的拍摄在单源匆匆一瞥,似乎是在说不要在3.2.0版本存在MC4源的方法和类。可能有功能被破坏。我运行的网站是为所有意图和目的建立针对最新的dll的MVC3站点。

A word of caution - Taking a cursory look at the Mono source, there appears to be methods and classes in the MC4 source that do not exist in the 3.2.0 build. There may be features that are broken. The site I am running is for all intents and purposes an MVC3 site built against the latest dlls.

微软DLL文件复制


  • System.Web.Abstractions - 4.0

  • System.Web.Helpers - 2.0

  • System.Web.Mvc - 4.0

在您复制的DLL,如果你仍然有问题,你可能必须做一些侦探工作,如果上面的修复不起作用。如果你得到一个错误消息说,单找不到DLL,它通常是三个原因造成的:

Once you copy over the dlls, if you're still having problems you may have to do some detective work if the above fix doesn't work. If you get an error message saying that Mono can't find the DLL, it's usually one of three reasons:

故障排除


  1. 是不具备的dll - 的您可以尝试使用该DLL的Microsoft版本

它找一个旧版本时,正确的安装在GAC或项目文件夹中的DLL - 项目中的一个组件可能参考该版本的某个地方。您可以使用绑定重新定向迫使特定版本已经代替

It's looking for an older version of the DLL when the correct one is installed in the GAC or in your project folder - An assembly in your project is likely referencing that version somewhere. You can use a binding re-direct to force the specific version you have be used instead

它还是老样子找不到DLL - 添加的组件,你的web.config的编译/组件部分

It stil can't find the dll - Add the assembly in the compilation/assemblies section of your web.config

您会得到一个无法找到视图找遍......消息 - 如果任何在该特定文件夹的意见的意见有编译错误,那么你会收到此消息<。 / EM>

You're getting a 'can't find view searched...' message - if any of the views in that particular views folder have compile errors, then you'll receive this message.

这篇关于使用.NET MVC 4运行3.2.0单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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