Search code examples
c#apiasp.net-corenetwork-programminglan

I can't call API from another PC at the same network


I connected two laptops together with a wi-fi modem.

  • Laptop1 got the IP 192.168.0.20
  • Laptop2 got the IP 192.168.0.21

I launched an ASP.Net Core web application on Laptop2 on port 44382. I turned off both laptops' firewalls.

The result of ping 192.168.0.20 from laptop2 Ping 0.21 from 0.20

The result of ping 192.168.0.21 from laptop1 Ping 0.20 from 0.21

When I call my API from the laptop2(localhost) there is no problem and I see the result My API call

The problem is when I call API from laptop1(another laptop), after a long time I see this enter image description here

I can't find what my problem is.


Solution

  • You're most likely using IIS Express, which doesn't automatically bind everything the way you need for remote access. This answer breaks down what you'll need to accomplish that fairly well, but you may just want to look at installing IIS.