Override site binding with VS2015 and IIS Express

I am implementing OAuth authentication on an MVC6 site using VS2015 RC. The previous incarnation of the site required user binding, and I am trying to achieve the same with VS2015. However, debugging with IIS Express is difficult.

If I change the dnx "web" command to use an alternate URL, everything works as expected:

"commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://www.devurl.co.uk:31122", "gen": "Microsoft.Framework.CodeGeneration", "ef": "EntityFramework.Commands" }, 

Running using dnx command

If I try to do the same with IIS Express by changing the applicationhost.config file (in the project / .vs / config folder according to the wildcard host name in IIS Express + VS 2015 ) ...

 <sites> <site name="WebApp1" id="1"> <!-- removed for brevity --> <bindings> <binding protocol="http" bindingInformation="*:31122:www.devurl.co.uk" /> </bindings> </site> <!-- removed for brevity --> </sites> 

... the new site entry is bound to "localhost".

 <sites> <site name="WebApp1" id="1"> <!-- removed for brevity --> <bindings> <binding protocol="http" bindingInformation="*:31122:www.devurl.co.uk" /> </bindings> </site> <site name="WebApp1(1)" id="2"> <!-- removed for brevity --> <bindings> <binding protocol="http" bindingInformation="*:31122:localhost" /> </bindings> </site> <!-- removed for brevity --> </sites> 

The site is now running using the localhost binding. VS happily opens the dev url and tells me that the service is unavailable.

Debugging with IIS Express

How can I instruct VS2015 to use an existing site and bind when debugging using IIS Express?

+7
asp.net-core visual-studio-2015 asp.net-core-mvc iis-express
source share
1 answer

I used the instructions defined here with a slight modification:

Wildcard host name in IIS Express + VS 2015

To do this, I left the localhost binding and added an extra binding for *. This should be done in ~ ProjectFolder ~ / .vs / config / applicationhost.config, and not in the old document location / IISExpress .....

The adjusted binding looks in my case:

 <bindings> <binding protocol="http" bindingInformation="*:4355:localhost" /> <binding protocol="http" bindingInformation="*:4355:*" /> </bindings> 
+2
source share

All Articles