Using Xamarin Studio for Web API projects

I switched from running Visual Studio using Parallels on my Mac to using Xamarin Studio directly on my Mac. Had too many issues getting my phone detected properly. So far everything is great for the mobile applications using XS directly on my Mac.

I see that Xamarin Studio has project templates for MVC web applications. The MVC project works from my testing, but has anyone had any success getting Web API to work? It seems as though mono doesn't support the latest version of Web API that is available through the nuget repository. There doesn't seem to be a way to pull older versions. From my research it seems as though one needs the ASP.NET MVC 4 nuget package. It would be great if I could bypass Windows and VS all together for mobile development.

Posts

  • RicardoRomoSoaresRicardoRomoSoares BRBeta ✭✭
    edited October 2014

    I try this too. And I want to take old version on nuget. It would be necessary with others library too.
    I make a test, and the erros threw when I starting to use Html helper.

    for example Html.ActionLink in MVC5.2, that is only what I would to take in nugget with XS.
    I have a old project to test mvc, that use MVC4.

    I did a test with html.ActionLink and works.

    There are a bug in process on mono: https://bugzilla.xamarin.com/show_bug.cgi?id=16475

  • mattwardmattward GBMember Xamurai
    edited October 2014

    You can get older NuGet package versions if you use a package version search, example below:

    Microsoft.AspNet.Mvc version:*
    

    The alternative is to install the NuGet extensions addin which provides a basic PowerShell console so you can run Install-Package Microsoft.AspNet.Mvc -version 5.2

    Not sure if that helps you with getting Web API to work though.

  • RicardoRomoSoaresRicardoRomoSoares BRBeta ✭✭
    edited October 2014

    Nice!

    This work.

    Who want this install the MVC package Microsoft ASP.NET MVC 4 4.0.20710

    PM> Install-Package Microsoft.AspNet.Mvc -Version 4.0.20710

    this works with the current mono version 3.10.0.

    The web.config need to be change to this version both in root and View web.config.
    To do it see http://stackoverflow.com/questions/21827225/xamarin-asp-mvc-4-action-with-parameters-not-working

  • fllukeflluke USMember

    @mattward‌ Awesome! I searched high and low and didn't come across either of these solutions for installing older packages.

  • zhouhaozhouhao SGMember

    Any news? Is there a Xamarin solution (template) for Web API project? Thanks.

Sign In or Register to comment.