Click here to Skip to main content
Click here to Skip to main content

Specifying Ports When Running Applications in Visual Studio

, 10 Oct 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
This post will provide a short walk-through for handling and updating these areas of your application to gain more control over debugging, testing and running your applications through Visual Studio.

I’ve come across several questions over the past few months with developers asking questions regarding the port values that are used when running applications through Visual Studio, primarily where are the values coming from and how to set them. Although this may be a fairly trivial topic, it appears that many users are unaware that the ports that are being used aren’t always as “random” as they may initially appear.

This post will provide a short walk-through for handling and updating these areas of your application to gain more control over debugging, testing and running your applications through Visual Studio.

The Problem

You have multiple Projects that are within your Solution that are going to be running along-side one another and you want to assign explicit ports to each of them (because you don’t want to have to type a different port within your browser each time).

The Solution

You can set these properties depending on if you are using the local Visual Studio Development Server or through IIS within the Properties of your current Project through the following steps :

  • Right-click on your Project within the Solution Explorer in Visual Studio.
  • Select the Web tab on the left-hand side.
  • You should find a section called Servers within the right-hand pane.
  • You should then see the following area that will allow you to either explicitly use a Specific Port or Auto-Assign Port.
Visual Studio IIS and Server Settings

You can control information about the Ports and Visual Studio Hosting environment easily.

Each of the sections listed within the Servers area will permit you to make changes to the environment that your applications are run in during the debugging process and should provide a bit more control for you (especially if you need to test specific features and functionality through IIS.)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Rion Williams
Software Developer (Senior)
United States United States
An experienced Software Developer and Graphic Designer with an extensive knowledge of object-oriented programming, software architecture, design methodologies and database design principles. Specializing in Microsoft Technologies and focused on leveraging a strong technical background and a creative skill-set to create meaningful and successful applications.
 
Well versed in all aspects of the software development life-cycle and passionate about embracing emerging development technologies and standards, building intuitive interfaces and providing clean, maintainable solutions for even the most complex of problems.
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141220.1 | Last Updated 10 Oct 2013
Article Copyright 2013 by Rion Williams
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid