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:

5 comments:

  1. C51A01C060
    Many websites now offer a variety of resources to help users improve their skills and knowledge. For example, online platforms provide tutorials, articles, and forums where individuals can learn from experts and peers alike. These tools are designed to be accessible and user-friendly, fostering a supportive learning environment. To explore some of the best options available, you can visit [1]. Embracing digital learning opportunities is essential in today's fast-paced world.

    ReplyDelete

Search This Blog