GRPC Init throws "IOException: Failed to bind port " when running from .netcore app

Viewed 4722

I have a .net core app which spins up a grpc server. I was able to run it locally without a problem until I had Windows updates today. After Windows applied latest updates, I tried to run my .net core app, but I keep getting the following error.

System.IO.IOException: Failed to bind port "127.0.0.1:50001" at Grpc.Core.Server.CheckPortsBoundSuccessfully()

I went to firewall and opened access to the port that grpc has problem accessing. It did not help. Anybody had this issue?

2 Answers

I wasted 2 days on this and finally got the answer. Windows update caused certain valid to use ports to be excluded and as a result I couldn't run any app that listens on those excluded ports.

Here is a link to Microsoft article. Windows update blocking previously valid ports

You can change the startup project to current selection by right click on your solution. or you can set multiple starup project as shown in pictur. it solve my issue.. step1

step 2 step 2

click apply

Related