Remove vertical dotted indentation lines in Visual Studio 2017
Just press ctrl+E,S and it will be removed.
There is an option under Tools → Options → Text Editor
called Show structure guide lines
that should remove that.
The same thing in VS2019 is called Show guides for declaration level constructs
in the section of Tools
→ Options
→ Block Structure Guides
; you might want to uncheck Show guides for code level constructs
as well.
In the last version of Visual Studio Code, downloaded in July/2017 (please note that this is not Visual Studio, but as @tambre pointed out, this may help in VS too), the name of this setting changed:
Go to the menu Code->Preference->Settings and search for "renderIndentGuides". The complete setting should appear as:
"editor.renderIndentGuides": true,
Change it to false and that's it.