Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Visual Studio 2013 modifying the IISExpress applicationHost.config

I have a website project using Visual Studio 2013, and each time I open it, it keeps adding a new entry for the website project in applicationHost.config. I use IISExpress for my development, however I always create a custom entry to provide some specifics and I have it configured to use port 80, so I would like to not have Visual Studio make any modifications to this file.

I have gone into Tools > Options > Web Projects and unchecked "Use the 64 bit version of IIS Express for web sites and projects", closed the solution, removed the entry from applicationHost.config and re-opened the project in Visual Studio, however it still continues to add an entry to applicationHost.config and name my website project whatever that entry is named.

Is there a way to disconnect Visual Studio entirely from IISExpress? I like using it, but I want to control that service and configuration myself.

like image 851
Kyle B. Avatar asked Oct 18 '13 19:10

Kyle B.


People also ask

How do I disable IISExpress EXE?

Closing IIS Express By default Visual Studio places the IISExpress icon in your system tray at the lower right hand side of your screen, by the clock. You can right click it and choose exit. If you don't see the icon, try clicking the small arrow to view the full list of icons in the system tray.

Where is the ApplicationHost config for IISExpress?

Configure IIS express on visual studio vs folder (Hidden) -> Config -> applicationhost.

What is ApplicationHost config file?

ApplicationHost. config is the root file of the configuration system when you are using IIS 7 and above. It includes definitions of all sites, applications, virtual directories and application pools, as well as global defaults for the web server settings (similar to machine.

What is IIS Express in Visual Studio?

IIS Express is a lightweight, self-contained version of IIS optimized for developers. IIS Express makes it easy to use the most current version of IIS to develop and test websites.


2 Answers

Inside the bindings section of the site section, create a new binding in addition to the localhost version like so:

 <bindings>      <binding protocol="http" bindingInformation="*:21232:localhost" />      <binding protocol="http" bindingInformation="*:21232:*" />  </bindings> 

After having both lines, VS stopped making new site sections.

like image 189
Stuart Allen Avatar answered Oct 06 '22 03:10

Stuart Allen


How to: Specify a Port for the Development Server

I just tried out the method described in the above msdn article to change the port IIS express uses (didn't try 80 though).

  1. right click the website in solution explorer, remove (won't delete files)
  2. edit the applicationHost.config file, change the binding
  3. "add existing web site" in Visual Studio (point to the folder of site you previously removed)

At that point it doesn't seem to create a new entry in applicationHost.config, and uses the new port.

like image 34
Anssssss Avatar answered Oct 06 '22 03:10

Anssssss