Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Universal Windows project - HttpClient exception

I'm trying to implement REST client in Universal Windows project (in Windows 10 universal app) using HttpClient, but the following line:

var response = _client.GetAsync(address).Result; 

throws an AggregateException with the following message:

Access denied. A network capability is required to access this network resource

More surprisingly, the request isn't event sent to server. How can I solve this problem?

like image 866
Mrk Avatar asked Oct 20 '15 11:10

Mrk


1 Answers

Double click on the Package.appxmanifest file in your project.
Click on the "Capabilities" tab. Add the Private Networks capability to your project.

like image 181
kain64b Avatar answered Oct 08 '22 01:10

kain64b