1

I'm using Xamarin.Forms application with Azure Mobile App as backend service. How can I debug with local instance of the service?

Tried following, but returns error :

    public const string applicationURL = @"http://192.168.0.4:59996/";
    public const string gatewayURL = @"";
    public const string applicationKey = @"Overridden by portal settings";

    public static MobileServiceClient client = new MobileServiceClient (
        Constants.applicationURL, Constants.gatewayURL,
        Constants.applicationKey);

Error thrown is :

System.Net.WebException: Error: ConnectFailure (Connection refused) ---> System.Net.Sockets.SocketException: Connection refused

Following are the keys in Mobile App service:

<add key="MS_MobileServiceName" value="XXXMobileApp" />
<add key="MS_ApplicationKey" value="Overridden by portal settings" />
<add key="MS_MasterKey" value="Overridden by portal settings" />
<add key="MS_SigningKey" value="Overridden by portal settings" />
<add key="EMA_MicroserviceID" value="XXXMobileApp" />
<add key="EMA_RuntimeUrl" value="https://groupa2edxxx.azurewebsites.net" />
<add key="EMA_Secret" value="Overridden by portal settings" />

How should I define the client in Xamarin?

PS: The local host service is running in debug mode.

Randeep Singh
  • 998
  • 2
  • 11
  • 31
  • Try hitting the url from another computer. Your computer might be blocking connections from other devices. – Andres Castro Jul 21 '15 at 16:31
  • have you tested your service using a proxy like [fiddler](http://www.telerik.com/fiddler) – SWilko Jul 21 '15 at 16:31
  • Is your local service on a different machine? If so, check out http://stackoverflow.com/questions/31360068/need-to-access-my-vm-windows-8-local-iis-from-my-mac-os-x-host-machine?noredirect=1 – lindydonna Jul 21 '15 at 19:40
  • @acastr7, yeah, I was not able to access the url from another machine. – Randeep Singh Jul 22 '15 at 04:10

1 Answers1

1

My issue was that the localhost IISExpress was not accessible from any other device. Had to configure IISExpress based on following article: https://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-how-to-configure-iis-express/

I'm still facing an error but this could be unrelated to this question. (More update on this later perhaps)

Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException: The request could not be completed. (Unauthorized)

Randeep Singh
  • 998
  • 2
  • 11
  • 31