ASP.NET Core project using local host how to view on mobile?

jewel 1,186 Reputation points
2023-09-13T10:15:08.5866667+00:00

Can I view my dotnetcore web application on mobile from same network? I need it to check the responsivity of my project. I'm looking for help from the experts as I can't find the right link after searching a lot. I am using Visual Studio 2022. I also found my IP address and port number.

Developer technologies ASP.NET ASP.NET Core
0 comments No comments
{count} votes

Accepted answer
  1. Johan Smarius 470 Reputation points MVP
    2023-09-13T11:20:43.5+00:00

    For checking the responsivity of your site, you do not need a mobile device. You can use the developer tools in Edge, Chrome, and Firefox to show your web application on different devices.

    If you do want to use a physical device you could follow the options in this post: https://stackoverflow.com/questions/39732279/remotely-connect-to-net-core-self-hosted-web-api

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-09-13T15:24:12.01+00:00

    You would use the ipaddress or machine name instead of local host. Unless you are using port 80, you probably need to open the firewall.

    Mobile devices are more strict about https certificates, so see developer documentation for install on phone if you want to test https. You will also need to make a cert as VS only makes one bound to localhost, and you will need one for the machine name.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.