Visual Studio
Intro
All you want to know about Visual Studio.
Downloading
Landing page for Visual Studio https://visualstudio.microsoft.com and Visual Studio Code: https://code.visualstudio.com/
Shortcuts
Control + Shift + ]
to find matching braceIn VS type “ctor” and press TAB twice to automatically generate the constructor code for a class.
"propfull" will autogenerate the setter/getter code for a property.
To comment code out, highlight code, press
Control-k, Control-c
(there is also a button to do this)You can start typing the name of an object and press TAB for VS to auto-complete it.
When implementing the methods/properties of an interface in a subclass, hover over the interface name and the VS lightbulb will show up. Select "Implement Interface" and VS will autofill the code for those methods/properties
In VS's C# Interactive window, you can type "#r <class dll to load>" to load one of your classes' DLL. You can then invoke your methods directly
Control-. will automatically add "using <namespace>" for a class that is missing its using line.
Use three slashes (///) on top of a method/class and VS will create XML comments for their APIs
Extensions
A lot of extra features can be added via VS Extensions: https://marketplace.visualstudio.com/
Use Spaces Instead Of Tabs
First configuration should be to turn off tabs: Tools → Options → All Languages → Tabs
If the file already has tabs, select the text and perform: Edit → Advanced → Untabify Selected Lines
© Roger Cruz - All rights reserved