(WinRT) I am getting a "Connection failed (error code is -2147024891)" exception when trying to set up a network connection from a WinRT application. What's the matter?

The error code above ( 0x80070005 ) stands for the Access Denied error. You might get this error when connecting to network resources (e.g. by using 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, please double click on 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 checkboxes are ticked:

  • 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 applications 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