Saturday, July 18, 2020

Connecting to IIS Express from an Android emulator

I've been struggling with this. While working on a proof of concept of an Android app connecting to an API running in my localhost, the Android app could not to IIS Express. At first, I thought it had to do with using a self-signed certificate. But even without SSL I still got a network error. This is how I fixed it:

1) First, the Android app should connect to the local ipv4 address, not localhost, not 127.0.0.1

2) Modify the file applicationhost.config as indicated here https://blogs.blackmarble.co.uk/rfennell/2012/11/06/using-iisexpress-for-addresses-other-than-localhost/, by replacing localhost with *

3) Restart IIS Express

And that's it!




No comments: