Xamarin Studio is a great Mono IDE (Integrated Development Environment) in OS X area. At the time of writing this article, the version of Xamarin studio and mono framework I use are :
Xamarin Studio
Version 4.2.1 (build 1)
Runtime:
Mono 3.2.5 ((no/964e8f0)
GTK+ 2.24.20 theme: Raleigh
GTK# (2.12.0.0)
Package version: 302050000
Xamarin Studio includes with ASP.NET MVC 2 and 3 project template. While trying to create ASP.NET MVC 3 project, I got couples of errors such as authorization access etc. The good news is even though there is no project template for ASP.NET MVC 4, we still can convert our ASP.NET MVC 3 to run as ASP.NET MVC 4. The steps are :
- Create an ASP.NET MVC 3 project either with aspx or razor view engine
-
Run the project via Xamarin studio menu (Run > Run With > Mono Soft Debugger for ASP.NET. While running the project, we may got an error message :
To solve the error, run the following command in terminal : </code> - Re-run again the ASP.NET MVC project. We may get another error message. To solve the error message, just use NuGet package manager, search for “ASP.NET MVC 4″ and add reference to it and its dependencies.
-
Re-run the ASP.NET MVC again. Now we may get another error message as following :
As the error message, we need to make our ASP.NET Web Pages version to
2.0.0.0
in web.config. So just openweb.config
and changewebpages:Version to 2.0.0.0.
as follow : -
Change assembly version declared in root
web.config
and/View/web.config
of the following
assembly from to
System.Web.WebPages.Razor
1.0.0.0 2.0.0.0 System.Web.Mvc
3.0.0.0 4.0.0.0
Now re-run the project again via Xamarin Studio and our project should run well as expected.
References
- http://curtis.schlak.com/2013/09/29/setup-asp-net-mvc-4-on-monodevelop.html