The iPhone app that I'm writing uses
ServiceStack to communicate with an existing ASP.NET MVC app that I've had in production for a long time. The way I have things set up is that I'm doing my iPhone development on MonoTouch on the Mac side, and I use VMWare Fusion to run Windows as a guest OS. This blog will highlight a few of the tips that I found to be handy.
- Getting IIS Express to work from an external server (even the Mac OS host) is theoretically possible. I found articles lying around the net saying it could work, but it never worked for me. I ended up going back to Cassini (WebDev.WebServer40.exe) and using tcpTrace to listen externally on port 8080 and forwarding to my local port (e.g. 1234).
- In order to get VMWare Fusion using NAT to talk to my Windows OS on a consistent IP address, I added this section at the bottom of /Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf (replacing the MAC address of the Macintosh and the IP address from the Windows machine)
host winguest {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 172.16.123.123;
}
- In order to get external devices (e.g. my iPhone connected to the same wireless network) to see in to the Windows OS, I set up port forwarding to route requests coming in to the Mac on port 80 to point to port 8080 on the Windows machine. I did this by modifying this section in /Library/Preferences/VMware Fusion/vmnet8/nat.conf:
[incomingtcp]
80 = 172.16.123.123:8080
After all of that, I can communicate from my iPhone through my Mac into the VMWare-hosted Windows machine to get at the data.