问题
The error:
Unhandled exception. System.Net.Sockets.SocketException (99): Cannot assign requested address
I am trying to run a small Dotnet Console Application that talks using sockets in Debian. The machine that it runs on is a VM on Google Cloud's Platform. It runs well when running in Visual Studio on the Windows Machine. On the Linux, it doesn't run both when trying to run from the source code, and after publishing...
I checked-ish the ports, I allowed using UFW the ports that are used, as well as opened ports from the Google Platform's integrated firewall. I am not sure how and what code is relevant so I'm gonna post upon request.
回答1:
was able to solve it. The issue was that I was using the Google Platform's external Ip Address to listen on when I actually needed to use the internal Ip address (of the VM) as everything is redirected from one to another.
It can be seen in the photo.
来源:https://stackoverflow.com/questions/58770370/cannot-assign-requested-address-error-when-running-dotnet-console-application