10

I've installed the freshly released Mono 3 and MonoDevelop on my Mac, and I was keen to get a simple MVC web application working with razor view pages.

When I File-New-Solution up a MVC 3 Web Application (razor), the thing doesn't compile, giving the error:

The type or namespace GlobalFilterCollection could not be found

It's because 2 references are not working - System.Web.Helpers and System.Web.WebPages. When I look at these in the references list in MonoDevelop, they are red with "Assembly not available" - looking at the references in more detail it seems I'm referencing system.web.mvc 2.0.0.0, whereas everything else is 4.0.0.0. Can anyone advise?

4

2 回答 2

3

I eventually got mine to run by referencing the System.Web.Mvc.dll found in /Library/Frameworks/Mono.framework/Libraries/mono/4.5/

I also had to bring over System.Web.Helpers.dll from a Windows box and update the Web.Config using one generated by Visual Studio.

There's probably a better way to do this (please be a better way), but figured I'd pass on what I found.

于 2012-10-25T02:47:49.393 回答
1

Add packeges "Microsoft ASP.NET MVC" and "Microsoft ASP.NET Web Pages" from NuGet.

于 2015-03-16T09:04:04.077 回答