Skip to content

Instantly share code, notes, and snippets.

@kepop1
Last active February 9, 2020 23:47
Show Gist options
  • Save kepop1/03e3e1d6b391dff08124bc226d361aff to your computer and use it in GitHub Desktop.
Save kepop1/03e3e1d6b391dff08124bc226d361aff to your computer and use it in GitHub Desktop.
Debugging Visual Studio 2017 inside Parallels on MacOS

Debugging Visual Studio 2017 with Parallels inside Mac

NOTE! This may not work on the later versions of Visual Studio!

This should gist should help you in creating a local development environment that allows the debugging of Visual Studio 2017 inside of Parallels (in my case running Windows 10)

The result of this enables you to debug Visual Studio through the Mac bridge, e.g. selecting debug in Visual studio, and the default web browser launches in Mac.

The project should work in Windows without being modified beforehand, fix any issues here before setting it up on Parallels

I've used port 57877 however this is what the local project was using at the time. You can use whatever port you would like (avoid any protected ports)

Where to start:

  1. Install Parallels and Windows 10, with Visual Studio 2017 (This probably works with all editions of Visual Studio).
  2. Change the default settings of the Visual Studio project solution (.sln), so the web server settings app url to: windows:57877
  3. Open Windows Powershell and run the command Add netsh http add urlawl url=http://windows:57877 user=everyone
  4. Run Visual Studio in Debug mode, check the solution still builds, and access the url from the Window's browser of choice.
  5. If that's worked fine, open the Parallels menu/'control center' and then click the cog (Settings) for the Window's VM Configuration options.
  6. Navigate to the Network options and change the source to "Default Adapter" from "Shared Network (Reccomended)"

Now that's Parallels and Windows setup correctly, it's time to move onto the Mac settings.

Where to finish:

  1. Type ipconfig into Command Prompt inside Windows, and take the IPv4 address, this can be copied and pasted for happiness.
  2. Next run inside the Mac Terminal type: sudo nano /private/etc/hosts, this is a list of all the accepted IP addresses for Mac with a Hostname.
  3. Inside this file, move down to the bottom line, and add the IPv4 address copied earlier, giving the name to the side as 'windows'
  4. Now this is done, try Launching Visual Studio in Debug mode with the launch settings set to "Open in Mac"
  5. If it doesn't automatically launch try just visiting the url windows:57877 on your mac.

Troubleshooting

  • Ensure you have .NET Core SDK installed when running the project as it can be forgotten about with a fresh install!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment