ionic2 with Visual Studio + IIS Express

Developing Ionic2 on VS2015 is much easier than I thought.

You will have pretty nice debugging experience and nice emulator from Visual Studio.

However, there is always a devil in the details.

Let's say if you want to make the Ionic app talk to your local IIS Express that serves your Web API, it won't work right out of box.

First of all, the VS Android Emulator use a virtual network adapter with a magic IP to connect to the localhost,

Since IIS Express naturally only binds to localhost, it doesn't know about the IP from this adapter.

To make IIS Express aware this, a new binding needs to be add in applicationhost.config.

in vs2015, it is .vs\config\applicationHost.config

<site name="ProjectName" id="1"> [blah blah blah] <bindings> <binding protocol="http" bindingInformation="*:1234:localhost" /> <binding protocol="http" bindingInformation="*:1234:" /> </bindings> </site>

Since I forgot this one twice during the development, it deserves my time for this post.