For my upcoming Flatiron School Meet-up talk, I’ve been learning about ASP.NET MVC 4 Web Api’s. My aim is to be able to build a back end for an iOS App eventually; so I am planning to put all of the moving parts together on my MacBook.
Since I need Visual Studio to build ASP.NET Web Api’s, I purchased Parallels and installed Windows 7 as a virtual machine. Then I installed Visual Studio 2013 and started getting my hands dirty. Little did I know that I needed to take quite a few steps to be able to access my web application from Safari OS X.
Here are the steps that I followed to make all this work:
1) Disable Firewall in Windows 7: Obviously the ideal way of dealing with this would be opening ports for your web applications. But since I’m only planning to use my Parallels virtual machine for ASP.NET development, I took the risk and disabled the entire firewall.
2) Fix Parallels Sharing Preferences Before Installing Visual Studio: This took me the longest time. In order for IIS Express to find its configuration files, you need to make sure Parallels does not map OS X Documents folder to Windows Documents folder.
3) Update Network Adapter Settings for your Windows 7 Installation: We want OS X to be able to ping Windows 7. In order for this to work, you need to make sure both OS’s are on the same subnet. I made this work by tweaking the Parallels settings:
4) Fix IIS Express Configuration: Your IIS Express configuration file resides in this location: %USERPROFILE%\Documents\IISExpress\config\applicationhost.config
You need to open this file and fix the following line which corresponds to your Web App. This will enable us to reach this app with computer name, instead of forcing us to use http://localhost
5) That’s it! Just run IIS Express: You need to open a command prompt with Administrator privileges and run the following command
“C:\Program Files (x86)\IIS Express\iisexpress.exe” /site:YourWebAppName
Now go to Safari on OS X and run your test!