The entry you added tells Windows to map your custom URL to your local IP address. Now copy the hosts file from your desktop back into C:\Windows\System32\drivers\etc, and confirm that you want to overwrite the file. Edit the hosts file in a text editor, and add this line to the bottom: Navigate to C:\Windows\System32\drivers\etc and copy the file named hosts to your desktop. We can correct this by adding an entry in the Windows hosts file. Unfortunately, Windows doesn't know how to interpret our custom URL, since it doesn't resolve to an IP address. Adding your Project URL to the Windows Hosts file Otherwise, you'll receive an IIS error when attempting to access your site. NET Framework version as your Visual Studio project, and the Application Pool user has permission to your project's directory. Note: make sure your IIS site's Application Pool is set to the same. I'm using aspnetsite.local for this example, but this can be pretty much anything except localhost. Finally, in the Host name field, enter the URL you want to use to access the project. Open IIS Manager, right-click on Sites in the sidebar, then choose Add Web Site.Įnter the name of your project as the Site Name, then choose the project's root directory (the directory that holds your web.config file) in the Physical Path field. Once IIS is installed, we need to create a new IIS site to use with our Visual Studio project. We'll instead need to use the full-fledged version of IIS, which can be installed under Control Panel > Programs > Turn Windows features on or off > Internet Information Services. If you try to connect to from within OSX, you'll simply be connecting to your OSX machine. We want to use the second option - Use Local IIS Web Server - but which version of IIS should we select? Since IIS Express only allows sites to be created using localhost URLs, it won't work for our purposes. Use Custom Web Server - This allows us to use another custom server URL.Use Local IIS Web Server - This allows us to use either IIS or IIS Express, which must be installed on our local machine.Use Visual Studio Development Server - This is the default option, but it only allows traffic from the local Windows machine.You'll see 3 options in the Servers section: Right-click on your web project in the Solution Explorer and choose Properties, then select the Web tab. Luckily, Visual Studio gives you the option to choose a different development web server. Here's our sample application running on the built-in VS dev server - notice the localhost URL. External requests, even from the OSX host machine, are always blocked. Whenever you run or debug your web project in VS, the dev server spins up and makes your site available on a localhost port, such as My original goal was to expose this port to my OSX environment, but soon discovered that this is simply not possible - the VS dev server is only accessible by the local Windows environment. OSX Web Browser Parallels Windows VM Development Web Server Visual Studio Development Server Optionsīy default, Visual Studio web projects use a built-in development web server. So our goal is to allow traffic to freely flow like so: If you ping localhost from your Windows Command Prompt in Parallels, you'll receive a response from your Windows instance. If you ping localhost from your OSX Terminal, you'll receive a response from your OSX instance. Although both OS's live on the same hardware, you can think of them as two separate machines connected by a local network. Much like the Vatican exists as an independent state within Rome, our Windows virtual machine serves as our holy seat of power within the unclean OSX environment (I kid, I kid). After some trial and error, I arrived at a solution that's been working well for me, and wanted to share the setup process. One challenge I ran into when I first joined DoneDone (now 3 years ago!) was the difficulty in accessing my local Windows development environment from OSX. Ka Wai and I both use MacBook Pros with Parallels installed because it gives us easy access to all major browsers on OSX and Windows. DoneDone is built using ASP.NET, meaning our development environment is Visual Studio on Windows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |