By default Visual Studio creates an entry for each recognised web browser you have installed when you first launch the IDE. We all know that we should be testing our web applications in more than just our favorite browser (after all, our end users may be using any number of browsers).
Visual Studio supports the addition of other browsers; and using this feature you can add other browser modes such as incognito. Why I hear you ask; incognito mode is not just for naughty browsing habits. It also containerised your cookies, and history; so if you are debugging an application that uses an external authentication provider you won't inherit your existing sessions from other applications (my use case).
How to add Chrome Incognito Mode to Visual Studio's Debug Button
- Open the 'browse with' window from your menu bar (whilst a web application project is open). Strangely this requires your application to build before it will open!
2. Click Add and enter the following values:
Program: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
Friendly Name: Chrome Incognito
3. If you want this to be your default, select the new list entry and click "set as default".
Now you can debug your web application as if you were a first time browser every time!Thank you to Braydon Anderson for providing the image used in this post's header for free on Unsplash.com.