Accessing an ASP.NET Web Site on Parallels from Mac OS X

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. 

Firewall Settings

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.

Parallels Sharing Settings

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:

Screen Shot 2013-10-27 at 10.15.15 PM

4) Fix IIS Express Configuration: Your IIS Express configuration file resides in this location: %USERPROFILE%\Documents\IISExpress\config\applicationhost.config

IIS Express Configuration

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!

Screen Shot 2013-10-27 at 10.19.47 PM

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s