I am developing a web application in visual studio 2012 and every time I close and open visual studio it creates a new entry with default settings in IIS express's applicationhost.config and since I am using a browser from another machine (windows is in a vm) I have to go into applicationhost.config and fix the binding to * rather than localhost so I can browse to the website.
This is starting to get pretty annoying and I have searched online but I couldn't find any info on it. Does anybody happen to know how to stop this from happening?
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.
Configure IIS express on visual studioSelect the web application project and open properties -> select the web tab -> under server's select IIS express-> Specify the project URL. Now open the project folder and . vs folder (Hidden) -> Config -> applicationhost.
Right click your project > click Properties > select the 'Web' tab on the left > uncheck the 'Enable Edit and Continue' checkbox.
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.
Have you set the URL it should use in the project csproj file? You can lock it down there to localhost and a port number :)
For example:
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{whatever your guid is}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>12345</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>**http://localhost:portnum**/IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With