Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing assemblies with mono 3 MVC web app

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?

like image 709
Matt Roberts Avatar asked Oct 24 '12 07:10

Matt Roberts


2 Answers

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.

like image 157
cdeutsch Avatar answered Oct 22 '22 19:10

cdeutsch


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

like image 1
Артем Avatar answered Oct 22 '22 17:10

Артем