在UWP / windows 10中为MODBUS(端口502)开发的问题 [英] Issues developing for MODBUS (port 502) in UWP/windows 10

查看:274
本文介绍了在UWP / windows 10中为MODBUS(端口502)开发的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio / Windows 10 / .NET Core是否阻止了新UWP应用程序中MODBUS协议(端口502)的开发?



我有Windows 10 1803桌面与VS2017。我正在尝试创建一个使用端口502通信和轮询设备的应用程序,但每次我在调试模式下运行时都会遇到运行时异常:



尝试是以访问权限禁止的方式访问套接字。



但是,如果我使用完全相同的逻辑启动一个新的WPF项目,我可以进行通信用我的测试设备,并得到回复。





任何人都知道我不是吗?



我尝试过:



VS2017 UWP空白应用

VS2017 WPF App

解决方案

.NET Framework不会阻止任何这些东西。



UWP应用程序,出于安全原因。但是,您可以在应用清单中输入适当的命令告诉UWP您的应用需要网络访问。



阅读网络基础知识 - UWP app developer Microsoft Docs [ ^

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

解决方案

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[^]


这篇关于在UWP / windows 10中为MODBUS(端口502)开发的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆