1
votes

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.

1
Try hitting the url from another computer. Your computer might be blocking connections from other devices.Andres Castro
have you tested your service using a proxy like fiddlerSWilko
Is your local service on a different machine? If so, check out stackoverflow.com/questions/31360068/…lindydonna
@acastr7, yeah, I was not able to access the url from another machine.Randeep Singh

1 Answers

1
votes

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)