• Skip to primary navigation
  • Skip to main content

Collin M. Barrett

Collin M. Barrett is a staff software engineer in Memphis, TN.

  • Start
  • Blog
  • Resume
    • Projects
    • References
  • Contact
Home ❭ Code ❭ Incognito Debugging With Any Browser in Visual Studio
Incognito Debugging With Any Browser in Visual Studio

Incognito Debugging With Any Browser in Visual Studio

Published: 1.4.18

Clearing the Cruft

When I develop web applications in Visual Studio, I often need to resolve issues that are dependent on the state of the cache or cookies. By default, debugging in a browser from Visual Studio opens a new browser window but does not purge any preexisting cache or cookies.

Private/Incognito Browsing: Always Fresh

I like to configure Visual Studio to launch browser debug sessions in incognito/private browsing mode. Every debugging session is then fresh as if a user was visiting my application for the first time.

Visual Studio Debug Target Menu
Visual Studio Debug Target Menu

To configure browsers to debug in this mode:

  1. Click the Debug Target control’s right-side chevron to view the list of installed browsers.
  2. Click “Browse With…”.
  3. Click “Add…”.
  4. Configure the new target browser using the private/incognito command line argument. See the examples below.

Sample Browser Configurations

Chrome

Program:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
Arguments:
--incognito
Friendly Name:
Google Chrome - Incognito

Internet Explorer

Program:
"C:\Program Files (x86)\Internet Explorer\iexplore.exe"
Arguments:
-private
Friendly Name:
Internet Explorer - InPrivate

Firefox

Program:
"C:\Program Files\Mozilla Firefox\firefox.exe"
Arguments:
-private
Friendly Name:
Firefox - Private

Firefox Developer Edition

Program:
"C:\Program Files\Firefox Developer Edition\firefox.exe"
Arguments:
-private
Friendly Name:
FirefoxDeveloperEdition - Private

Edge

Not yet supported.

Opera

Program:
"C:\Program Files\Opera\launcher.exe"
Arguments:
--private
Friendly Name:
Opera Internet Browser - Private
Visual Studio Private/Incognito Debug Targets
Visual Studio Private/Incognito Debug Targets

via Scott Hanselman

Related

About Collin M. Barrett

Collin M. Barrett is a staff software engineer in Memphis, TN.

Subscribe! (max one per week)

Reader Interactions

Comments

  1. Dom says

    October 20, 2021 at 4:17 pm

    Thanks heaps for this. With latest EDGE, try:-

    “C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe” -inprivate

    Reply
    • Collin M. Barrett says

      November 21, 2021 at 3:49 pm

      👍

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Collin M. Barrett © 2023

  • LinkedIn
  • GitHub
  • Stack Overflow
  • DEV
  • Twitter
  • Goodreads
  • Sitemap