locked
AzureToDo.Mac sample app building with errors for iMobileServiceTable , MobileServiceClient RRS feed

  • Question

  • User58732 posted

    Downloaded the AzureToDo.Mac sample to learn how to get a MAC app working with Azure. (I have completed a Xamarin.Forms PCL app and have all device types successfully accessing Azure.) I have then tried to learn how to get the same app working for MAC.

    I get the errors "The type or namespace 'iMobileServiceTable' could not be found.... and The type or namespace 'MobileServiceClient' could not be found" in the TodoItemManager class.

    I have updated all microsoft packages such as BCL, and BCL.Build and Azure.Mobile.Client and Newtonsoft.Json. but no success. I notice that under References only Newtonsoft (FromPackages) and Microsoft CSharp, System, System.Core, System.Net.Http and Xamarin.Mac are the only items. But under Packages I have Microsoft.Azure.Mobile.Client, the packages for the items under References and heaps of other System packages.

    When you right click and select Edit References, none of the Microsoft.Azure.Mobile.Client methods are exposed for selecting.

    Can you let me know what I need to do to get the sample app working? Calling Craig Dunn if you are out there because you appear to authored the sample app.

    Sunday, November 6, 2016 10:37 AM

Answers

  • User14 posted

    Your first thought was correct @BrianWestrupp - the most recent version of the new Azure NuGet doesn't appear to have explicit Mac support (and as you also said, the old NuGet is deprecated).

    The "good" news is that Xamarin.Mac can also (pretty close to) behave as a plain old .NET 4.5 implementation, so by manually referencing the /packages/Microsoft.Azure.Mobile.Client.3.0.3/lib/net45 I was able to get it working again.

    I made two minor changes: * the Azure portal no longer uses a key - so I deleted that from the MobileServiceClient constructor * the default TodoItem doesn't seem to contain a notes field any more, so I commented that out for my test (but you could easily add the column and field back manually)

    Updated project is on GitHub. Ideally the NuGet would explicitly contain xamarinmac20 assemblies - will have to see if the Azure team will add them back...

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, November 8, 2016 4:59 PM

All replies

  • User35201 posted

    I've poked @CraigDunn to make sure he's seen this post. He'll likely swing by later with an update.

    Monday, November 7, 2016 4:00 PM
  • User58732 posted

    @ChrisHamons . Thanks - I forgot to praise you guys for Xamarin. I am an amateur coder having started with VB, Pascal and even dabbled in Assembly all while trying to break the software where I worked for twenty years as a software tester. So I do understand what goes into an application that is as easy as possible for the user to utilise, however also being human I do get frustrated at times.

    I await a great response from Craig, although I feel that he is going to say that the current version of Azure.mobile.client SDK does not support Mac unlike its deprecated predecessor Windows.Azure.Client.

    Tuesday, November 8, 2016 4:23 AM
  • User14 posted

    Your first thought was correct @BrianWestrupp - the most recent version of the new Azure NuGet doesn't appear to have explicit Mac support (and as you also said, the old NuGet is deprecated).

    The "good" news is that Xamarin.Mac can also (pretty close to) behave as a plain old .NET 4.5 implementation, so by manually referencing the /packages/Microsoft.Azure.Mobile.Client.3.0.3/lib/net45 I was able to get it working again.

    I made two minor changes: * the Azure portal no longer uses a key - so I deleted that from the MobileServiceClient constructor * the default TodoItem doesn't seem to contain a notes field any more, so I commented that out for my test (but you could easily add the column and field back manually)

    Updated project is on GitHub. Ideally the NuGet would explicitly contain xamarinmac20 assemblies - will have to see if the Azure team will add them back...

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, November 8, 2016 4:59 PM
  • User58732 posted

    @CraigDunn Craig you are a gem. Downloaded the updated AzureTodo.Mac app from GitHub. Built then run and perfect job. With my old version that I was using as a template for my actual app - I followed your advice and manually selected the two windows azure mobile extension from the net45 library and had to do the same for net.http.primitives. Built the app which was url'd to my backend azure testDB and it worked like a charm when run.

    One big thankyou to you and all at Xamarin. I can now progress with getting my actual Mac app running against the same azure db as my Xamarin.Forms PCL running on all 5 devices - ios, android, Windows 10, 8.1 and winphone 10 and 8.1. I have done this as a prove of concept for my son who is IT manager at a local company and he his trying to convert them to Windows front and backend and to use Xamarin with VS15 for development. (I am retired and an amateur coder having fun every day of the week).

    Once again thanks.

    Brian W

    Wednesday, November 9, 2016 4:53 AM
  • User310157 posted

    Hi there

    I'm looking in to using IMobileServiceClient (and tables) for my Xamarin.Mac app. I've used them for the windows version of my app, but even with all the help you have provided, I can't seem to figure out how to get it working.

    I've downloaded the GitHub app and referenced the included assemblies in my own project. However it throws an error when compiling (as did the GitHub project). The first error I get is something about missing Threading.Tasks> assemblies. I can fix the Threading.Tasks<> part of the error by (more or less) randomly referencing assemblies I find on my computer. However, attempting the same for the List<> parts results in another compiler error where all Collections.Generic.List types throws a compiler error about the same assembly being referenced multiple times.

    What is the best solution to this?

    Since this is related to the discussion, I thought it was ok to revive the topic.

    Thank you. Regards Frederik

    Monday, March 20, 2017 8:30 AM
  • User310157 posted

    Here is a screenshot of the line that causes the error and the error message.

    Could it be that List<>'1 is different from List<>?

    Monday, March 20, 2017 1:02 PM
  • User35201 posted

    You may want to create another thread @FrederikTheisen and post your full blog long (pasted to a pastebin/gist like service)

    Monday, March 20, 2017 9:14 PM