How to acces asp.net application outside vm

Mohammad Qasim 576 Reputation points
2021-02-01T12:50:33.063+00:00

Greetings,

I have designed asp.net application using vs-2017 ( its vm machine )

Problem : if I write it on Host " http://vmpc-12//localhost:55283/Default.aspx" it asks for credential but does not show anything after taking credentials ( just show blank page )

or if I write using my vmname which is " vmpc-12:55283/Default.aspx " it also does not work

Solution Required :How to access this application ( VMware machine ) on Host operating system .

in simple words, I want to call VMware (asp.net application ) on host operating system ,Guide me on this please

Attached is the image for reference

62584-local.png

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,288 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 48,826 Reputation points
    2021-02-01T15:52:40.033+00:00

    Your URL is wrong. The first part of the URL after the scheme is the host name (your VM's DNS name most likely). The optional next part is the path within the VM's default site where the app resides. After that is the remainder of the path as determined by the application. Your current URL is using the VM as the host but then localhost:### as the app. That is a DNS name for the local machine and port. That can only appear in the host portion of the URL and is not valid outside the server itself.

    If you are deploying your web app to the default web site on the server then you must have already created a web app in IIS to host it. The URL then becomes http://vm-dns-name/appname. So under IIS Manager you'd see the IIS instance, then Default Web Site then appname and within there is your app's configuration settings and binaries.

    If you created a brand new website on IIS instead of using the default web site then you get into a port binding issue as only a single app can be hosted in port 80 and that is default web site. In this case when you created the new website you would have had to set up a host header name. Then you would have had to create a DNS record to map to it. To access the site you'd then use the host header you specified. I suspect you didn't go this route.

    So if you are running the app locally, say for testing, then you're using something like: http://localhost:55283/Default.aspx. However when you deploy it to IIS on a server then you replace localhost:### which is a local port on your machine with the VM DNS name and the app name you set up under IIS http://vm-dns-name/app-name as I mentioned earlier.