ASP.NET MVC 3 on Mono - MVC app versus WebForms

2019-09-08 07:38发布

问题:

I got Mono installed and set up running underneath Apache. I was able to add in a index.aspx page and a web.config into the root directory and get this to work. Now deploying a MVC 3 app to the root directory, a default / request pulls back the generic Apache 2 Test Page.

What do you need to do to enable MVC apps? Specifically MVC 3?

回答1:

Take a look at the section "ASP.NET MVC3 Support" in thr release notes for Mono 2.10.

Apparently you need to copy some assemblies from MVC 3 into your bin directory and delete one.
Quote from the link:

Running Razor, MVC3 and WebPages

To get this stack running, you will need to copy Microsoft's MVC3 libraries into your bin directory:

  • System.Web.Mvc.dll
  • System.Web.Razor.dll
  • System.Web.WebPages.Deployment.dll
  • System.Web.WebPages.dll
  • System.Web.WebPages.Razor.dll

It is very important that you remove the Microsoft.Web.Infrastructure.dll from the bin directory for the above to work.