I am working in C# with VS2022. I am trying to create a TCP connection with another device, so I wrote a simple program by copying the code for the client creation from this example and substituting the IpAddress and port number with the ones of my device. The device can be pinged and I made all the checks to ensure it is listening on the port.
If run it in Visual Studio, the program works fine, but if I go in the bin folder and try to run the .exe file directly the program crashes when it uses the Socket.Send command.
I have tried seeing if it was a matter related to the Firewall, then I tried using WinDbg to see if I could get any additional information but it works on there. I also looked at the Event Viewer but I see nothing relevant.
acigoc is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.