1

I'm running VS2019 community, and I've created the default ASP.NET Core Web API project (ASP.NET Core 5.0), the one with the simple weather forecast example. And I am now trying to connect another computer to the URL. I run the example by using the [application name] in the run dropdown, and not IIS Express.

Both computers are connected via wifi to the same Router. I do an ipconfig on the server machine to get it's IP (192.168.1.108) And I have also enabled inbound connections from the ports 5000-5001 in the windows firewall setup

On the "client" machine I try to access the server with :

http://192.168.1.108:5000/swagger/index.html

or

https://192.168.1.108:5001/swagger/index.html

but neither seem to work? The page ends up timing out.

So on the machine running the server, I also completely disabled the windows firewalls (temporally, just to get things working).

But still get the same result?

Have I missed a step?

wforl
  • 91
  • 9

1 Answers1

0

Maybe this will help you. Try to add IP of your host into Program.cs
var host = new WebHostBuilder().UseUrls("http://192.168.1.108:5000")

Serhii
  • 723
  • 1
  • 4
  • 12
  • This works, thanks. But interestingly, it still works even after turning the firewall back on and removing the inbound port rules? shouldn't I HAVE to have inbound ports 5000-5001 open for this to work? – wforl Feb 11 '21 at 22:27
  • 1
    Maybe it's a program exception(is where a firewall rule is set up to ignore inbound and outbound traffic from a specific program) but I can't certainly say – Serhii Feb 11 '21 at 23:15