If i Run the project, it will launch using Google Chrome normal mode. But how can i launch it using Google Chrome Incognito Mode ?
-
2Any Idea how to do this in 2017? – Scott Cowan Nov 23 '17 at 10:38
3 Answers
It is very simple using visual studio 2015 / 2017 / 2019. You just need to add --incognito
as command line switch and name the browser something like Google Chrome - Incognito.
That you can do using Browse With.. option in visual Studio.
Step-1:
Step-2:
Note: You can do the same thing with Firefox and Internet Explorer. Here I'm adding Internet Explorer with the -private option.
For
Google Chrome : "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --incognito
Firefox : "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -private-window
Internet Explorer/Microsoft Edge : "C:\Program Files\Internet Explorer\iexplore.exe" -private

- 6,094
- 4
- 49
- 81
For Visual Studio 2017
- Select button that usually says IIS Express
- Click the down arrow
- Select
Browse With...
- Click
Add...
- Next to
Program
write the path to Google Chrome, eg.C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
- Next to
Arguments
write--incognito
- Next to
Friendly name
writeGoogle Chrome (Incognito)
(or whatever suits your needs)
- Click
OK
- Select your friendly name from before (eg.
Google Chrome (Incognito)
) and clickSet as Default
Now when you click the play button next to IIS Express, Google Chrome starts in Incognito mode.

- 1,365
- 1
- 15
- 28
Not the answer, but in case someone stumbles upon this question, looking for the Visual Studio Code solution, this worked for me:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Chrome: localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}/app"
},
{
"type": "chrome",
"request": "launch",
"runtimeArgs": [
"--incognito"
],
"name": "Incog Chrome: localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}/app"
}
]
}
However, this does not currently work using the Firefox debugging extension with the -private-window
argument. Hope it helps.

- 1,356
- 1
- 15
- 19