An attempt was made to access a socket in a way forbidden by its access permissions
I am working a code for years. I am using Windows 2003 Server here. I am the only admin in the system. I installed some security fixes in the system and after that the code started failing. I cannot find the actual cause behind that but somehow it looks a bit irritating. The error is -- System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions.If the code is running in admin then this kind of errors must not appear. How can I resolve this. Thanks.
Re: An attempt was made to access a socket in a way forbidden by its access permissions
If you go on web and search that error code then you can will ample of third party articles based on the same. The issue basically appears when the security settings in your system does not allow the code to access a port. It happens mostly to uncertified applications which are detected as threat. You will need to check the port that is used by the code and see whether it is blocked or not.
Re: An attempt was made to access a socket in a way forbidden by its access permissions
This is a permission issue. You require admin privileges and the problem will be resolved. In whatever account you are trying to execute does not has maximum privileges and due to which you are getting the error. To troubleshoot the same you can first try to create a new account. Apply full admin rights to the same and then try once again to execute the code. This is quiet enough to fix the issue. I had seen this error commonly faced by many and it is resolved once they are able to execute the same at full permission.
Re: An attempt was made to access a socket in a way forbidden by its access permissions
A few things you can also try to get rid of the error. The first thing you have to do is turn off your firewall on temporary basis only. And then execute the code. See whether it is working well or not. If yes then turn the firewall back again and test once. You have to configure the firewall service to get the code work. The second thing you can do is restart your pc and test once again. For temporary period just turn off the antivirus tool and run the code once. This is mostly some kind of security issue in your system which is causing the problem.