One of the fun things about joining a new team, an organization or just pair programming is that you just see how fellow programmers solve problems. It is interesting just to see what other developers do to avoid the frustration of repetition and the death by a thousand cuts. Most of the time I simply just assume this is the cost of doing work but it is good to remember if you have a problem someone else has probably experienced it and solved it.

So this seemed like a simple thing but I have long since wanted a way to start a new debugging web session from Visual Studio without having to clear the cookies or history of my browser. I would normally start debugging the web session then start another browser as InPrivate (Incognito) then navigate to the local site I am debugging, this was mildly annoying essentially three clicks where it should be one. Unbeknownst to me the answer has been staring right at me for years, I have known you can select the browser you want to debug with:

image

You can then add additional browsers but also add arguments that are supported by that browser to immediately start browsing in whatever state you like. Here are a list of private/incognito options for the major browsers:

  • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" –incognit
  • "C:\Program Files\Internet Explorer\iexplore.exe" –private
  • "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" –private

  There are more arguments for all the browser, but the disabling plugins argument is the one I have also used in this context:

  • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -disable-plugins
  • "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" –safe-mode
  • "C:\Program Files\Internet Explorer\iexplore.exe" –extoff


Comment Section

Comments are closed.