Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Does Visual Studio/Windows 10/.NET Core block development for the MODBUS protocol (port 502) in new UWP apps?

I have a Windows 10 1803 desktop with VS2017. I am trying to create an application that communicates and polls a device using port 502, but every time I run in debug mode I get a runtime exception:

"An attempt was made to access a socket in a way forbidden by its access permissions."

However, if I start a new WPF project using the exact same logic, I can communicate with my test device, and get a response.


Anybody aware of anything I'm not?

What I have tried:

VS2017 UWP Blank App
VS2017 WPF App
Posted
Updated 24-Sep-18 12:17pm

1 solution

The .NET Framework does not block any of that stuff.

UWP apps do, for security reasons. You can, however, put appropriate commands in your app manifest to tell UWP your app requires network access.

Read Networking basics - UWP app developer | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900