Tech Junkie Blog - Real World Tutorials, Happy Coding!: ASP.NET MVC; Get Rid Of The Port In The URL

Tuesday, September 25, 2018

ASP.NET MVC; Get Rid Of The Port In The URL

If you have been following along with the ASP.NET MVC tutorials you would have noticed that the URLs have a port next to them.  In this post we are going to get rid of that annoying port have a just the URL as localhost/{mycustomroute}



























Launch Visual Studio as an Administrator.  To remove the port, perform the following.  Right-click on the ASP.NET MVC project in the solution, and select "Properties"

























Click "Web" on the left navigation


















Select "Specific Page" radio button. This is to prevent ASP.NET MVC to guess what your route is and just follow the route that you defined.











In the "Server" section remove the port in the "Project Url" field









Click on the "Create Virtual Directory" next to the Project Url textbox








Now check "Override application URL" checkbox and remove the port in the URL right under it











Type Ctrl+S to save the settings, now when you run the application you will see that the port is gone





















Similar Posts:

2 comments:

Search This Blog