无法从WinRT连接到远程服务器

我正在制作一个应用程序,基本上只需要将一段XML发送到服务器并返回。 我遇到了麻烦,但要让它工作并得到非常奇怪的错误

public bool Post(string data) { string server="http://my-lan-computer:9091/foo" bool success = false; HttpClient client = new HttpClient(); try { client.PostAsync(server, new StringContent(data, Encoding.UTF8, "text/xml")).Wait(); //error here success = true; } catch { } return success; } 

我发布的服务器不是localhost,但它是我本地网络上的一台计算机。 我深深嵌套这个错误:

 innerException: {"An error occurred while sending the request."} innerException: {"Unable to connect to the remote server"} innerException: {"An attempt was made to access a socket in a way forbidden by its access permissions 123.123.123.123:9091"} 

我的应用程序具有Internet客户端function。 我可以通过其他商店应用程序访问我的本地网络和互联网。 我可以在firefox中访问资源获得正确的行为。 我没有启用防火墙,也没有阻止这些端口的防病毒软件

什么可能导致这个模糊的错误? 我该如何解决?

要访问LAN,您必须在应用程序清单中声明Private Networkfunction。 请注意,这与Internetfunction不同。