Access to web service not working when WinRT app is deployed as a package via PowerShell but works when deployed via debugger


  • My Windows Store app invokes WCF service which is hosted in a windows service, binding is NetTcpBinding. Both app and service are on the same machine.

    When I deploy the app to local machine or a tablet via (remote) debugger, the app can access the service successfully. When I create a package in Visual Studio and deploy the package via Power Shell on the tablet, then service is not accessible. However, this is the case only, when the app is installed via Power Shell first - as soon as I install it via debugger, then deployment via PowerShell also works. In other words, if I send the package to QA department and they install it via PowerShell to a "fresh" tablet,, the service will not work.

    Looks like the debugger is granting some other privileges to my Windows Store App ID? As soon as I change app key in the App manifest file and create a package again, deploy package via Power Shell, the connection to WCF service is again not working.

    Firewall is disabled, capabilities enabled are: Internet (Client), Internet (Client & Server), Private Networks (Client & Server).

    Any hints, suggestions?

    I have narrowed down access to the service to the following two lines to reproduce the behavior.

    var myClient = new StreamSocket();
    await myClient.ConnectAsync(new HostName(""), "4513"); // WCF service

    Again, when I deploy a package via PowerShell ConnectAsync method gets timeout, when deployed with debugger, connect is successful.

    Wednesday, June 25, 2014 6:10 AM