WinRT: troubleshooting connection failed exceptions

This article shows how to troubleshoot the following error in WinRT applications:

Connection failed (error code is -2147024891)

The error code above ( 0x80070005 ) is an access denied error. You might get this error when connecting to network resources (e.g., by using the FTP, HTTP, or SSH components) if the security policy of your WinRT/Metro application is not explicitly configured to allow for networking-related operations.

If you are coming across the above issue, double-click the Package.appxmanifest entry in the Solution Explorer of your WinRT project in Visual Studio. Choose the Capabilities tab on the form that appears. Check that the following options are enabled:

  • Internet (Client): If your application is expected to set up network connections to internet servers.
  • Internet (Client & Server): If your application is expected to establish connections to internet servers and accept incoming connections from other computers outside of a local network.
  • Private Networks (Client & Server): If your application needs to establish connections to servers residing in a local network.

Ready to get started?

Learn more about SecureBlackbox or download a free trial.

Download Now