Freeman
Freeman

Reputation: 3

C# UWP connect to tcp client via socket

When I will start a connection in a UWP application via socket and a tcp protocol, I will get a Access denied exception.

When I do this with a Windows Form Application I have with the same code no issues.

Can anybody help me?

Upvotes: 0

Views: 784

Answers (1)

Chrille
Chrille

Reputation: 1453

You need to add the Private Networks (Client & Server) capability to your app:

From learn.microsoft.com:

  • In Visual Studio Solution Explorer, double-click the package manifest file, Package.appxmanifest.

  • Open the Capabilities tab.

  • Select the device capabilities that your app uses.

Upvotes: 3

Related Questions