如何在Mono中运行MVC3或更高版本的应用程序

编程入门 行业动态 更新时间:2024-10-14 14:20:32
本文介绍了如何在Mono中运行MVC3或更高版本的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

默认ASP .NET MVC 3应用程序是在Microsoft Web Developer Express 2010中创建的

Default ASP .NET MVC 3 application is created using in Microsoft Web Developer Express 2010

应用程序发布到文件系统并复制到Debian服务器其中mono 2.10.8 ,Apache和mod_mono。

Application is published to file system and copied to Debian server where mono 2.10.8 , Apache and mod_mono are installed.

尝试运行应用程序导致错误:

Trying to run application causes error:

Server Error in '/mvc3test' Application -------------------------------------------------------------------------------- Could not load type 'System.Web.WebPages.Razor.RazorBuildProvider' from assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Description: HTTP 500. Error processing request. Stack Trace: System.TypeLoadException: Could not load type 'System.Web.WebPages.Razor.RazorBuildProvider' from assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. at (wrapper managed-to-native) System.Type:type_is_assignable_from (System.Type,System.Type) at System.Type.IsAssignableFrom (System.Type c) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildProvider.RegisterBuildProvider (System.String extension, System.Type providerType) [0x00000] in <filename unknown>:0 at System.Web.WebPages.Razor.PreApplicationStartCode.Start () [0x00000] in <filename unknown>:0 at System.Web.Mvc.PreApplicationStartCode.Start () [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 -------------------------------------------------------------------------------- Version information: Mono Runtime Version: 2.10.8.1 (mono-2-10/70a5c95 Wed Feb 8 18:11:45 CET 2012); ASP.NET Version: 4.0.30319.1

bin目录包含从Windows复制的必需dll:

bin directory contains required dlls copied from windows:

EntityFramework.dll mvc3test.dll System.Web.Entity.dll System.Web.Helpers.dll System.Web.Mvc.dll System.Web.WebPages.dll System.Web.WebPages.Razor.dll mvc3test.pdb EntityFramework.xml

,因此所有必需的dll都存在

so all required dlls are present

如何在mono中运行mvc3或mvc4应用程序或修复此错误?

How to run mvc3 or mvc4 application in mono or fix this error ?

推荐答案

您应该右键单击您的项目,然后选择添加可部署的依赖关系,然后检查前两个框(或所有3如果你使用sql ce)

There are more dll's required than those. You should right click on your project and choose Add Deployable Dependencies, and then check the first two boxes (or all 3 if you're using sql ce)

a href =haacked/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx =nofollow> haacked/archive/ 2011/05/25 / bin-deploying-asp-net-mvc-3.aspx

See this haacked/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx

哦,MVC4目前不支持2.10。 x分支。

Oh, and MVC4 is not currently supported by the 2.10.x branch.

更多推荐

如何在Mono中运行MVC3或更高版本的应用程序

本文发布于:2023-11-23 16:17:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622102.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   或更高   版本   如何在   Mono

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!