In case the browser LAN proxy setting solution doesn't work for you:
As mentioned in this similar Q&A How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?
Simply changing the port number of your web project can be a quick fix.