“Cannot assign requested address” error when running dotnet console application on Linux

ⅰ亾dé卋堺 提交于 2020-01-16 08:40:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!