简体   繁体   English

Xamarin:在Azure移动应用程序服务上使用本地实例调试应用程序

[英]Xamarin : debugging application with local instance on Azure Mobile App Service

I'm using Xamarin.Forms application with Azure Mobile App as backend service. 我正在将Xamarin.Forms应用程序与Azure移动应用程序一起用作后端服务。 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 System.Net.WebException:错误:ConnectFailure(连接被拒绝)---> System.Net.Sockets.SocketException:连接被拒绝

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? 如何在Xamarin中定义客户端?

PS: The local host service is running in debug mode. PS:本地主机服务正在调试模式下运行。

My issue was that the localhost IISExpress was not accessible from any other device. 我的问题是,本地IISExpress无法从任何其他设备访问。 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/ 必须根据以下文章配置IISExpress: https ://azure.microsoft.com/zh-cn/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. Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException:无法完成请求。 (Unauthorized) (未授权)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM