Can we run the Serialport libraries on web application

koteswara rao

Member
Joined
Feb 1, 2022
Messages
12
Programming Experience
3-5
Dear all,
Can we run the Serialport libraries on web application.
if yes,
please provide any links or any code in c#.
 
You would access the SerialPort class in a web application the same way you would in a desktop or console application. The bigger issue you'll have is that you to manage multiple web requests hitting your web application, but there is only a limited number of serial ports and someone may already be using it. And later when you go out to production, your host machine may not have any serial ports if they are hosted on VMs.

Now as for SerialPort libraries, you'll need to ask the authors of those libraries. If they are simple wrappers around the built in SerialPort class, then in theory they should just work. If they have any special threading requirements, they may run afoul with the way ASP.NET works and how it will often switch threads while handling incoming web requests.
 
Last edited:
Back
Top Bottom