Today for no reason I’ve faced a quirk from Visual studio: on attempt to connect to TFS I faced with strange error: Page not found.. And projects did load but with bunch of errors, like Microsoft.VisualStudio.Web.PasteJson package did not load correctly and many other saying that other packages did not load correctly.

Quick googling revealed that reinstall of VS helps, but I did not fancy that – too much hassle. Further googling also suggested that runnig as admin devenv /setup from your command line should fix the issue. And it did! Thanks to this answer on SO.

Also there was a suggestion to run devenv /resetuserdata if the above fails. But I have not tried that, because the first option worked for me.

And since I’m talking about devenv, here is the list of all the switches applicable to Visual Studio 2013.

You can see there options like /build or /clean or /rebuild – these do not start up Visual Studio, but rather work as Msbuild – build/clean/rebuild solutions. The more useful flags are

  • /safemode – start VS in Safe Mode. In case one of the extensions messes up big time.
  • /ResetSettings – resets user settings to default
  • /setupForces Visual Studio to merge the resource metadata that describes menus, toolbars, and command groups, from all available VSPackages. Whatever it means, but it fixes problems I’ve described above with loading packages.
  • Ricardo

    Thank you very much! saved me a lot of time =)

  • bkpearson

    Would rather it just prompt me that settings are corrupt, want to reset? [Yes] [No] [Report Settings Corruption]

    • Yes, that would be ideal. But we don’t live in ideal world, so have to deal with these issues. sigh…

  • That Guy With the Face

    Note: In the express version of Visual Studio, devenv.exe is named WDExpress.exe

    • Good point! I don’t use Express version, so never thought of it.

  • mbravc

    devenv /setup works like a charm, thank you!

  • Rudolf Dvořáček

    There should be another reason. I’ve received this bug today in the morning after machine restart.
    It could be problem with system Environment variable “Path” longer than 2048 characters.
    More info: http://allgeekallthetime.blogspot.cz/2012/01/path-over-2048-chars-kills-windir.html

    • O_O that’s a good find!
      Surely there is always a reason and nuke-all solution (the one I propose) is not the best. But time is money and sometimes it is faster/easier to nuke it, rather than try to debug the issue and fix the real problem.

  • Your still helping people today. Thanks