Visual Studio Development Tips to Speed Up Development
Edit this Article
- Enable CodeLens Feature in Visual Studio 2019:
CodeLens allows you to turn on or off settings about Application Insights. The Visual Studio will show you how many references to the function are. This helps in making a discission whether you even need the function or not.
- To enable Settings from CodeLens go to Tools => Options => Text Editor
- When starting to use Visual Studio, sometimes you don't want the browser to stop debugging or detach from the process.
- Every time you stop debugging and then refresh the browser the application stops showing because the IIS process is terminated
- The way you solve this problem is: When debugging, don't stop debugging with a big red button (stop) instead navigate to the Debug menu and click on detach-all, this will leave the application running in the background so you can do your modification to the page and still see the changes in the browser.
Short-Cuts in Visual Studio
- Ctrl + left arrow => To pad or apply formats to the code
- Ctrl + L => Cut the lines trailing in between code. Compacts the code together
- Ctrl + Space Bar => to See the properties of a DTO/POCCO object in C#
- Ctrl + RR => to rename every instance of the property or variable name at once
- Ctrl + f12 => to step into the C# Library code
- Highlight + Tab => to format or move code four spaces in
- Alt + Click + Drag => Muiltiple Code Selection
- Ctrl + T => to bring up a Slick Search bar that will allow you to search Fils, Words in Classes, and many more.
Aligning the Code
- Tab => Select a block of code and hit "Tab" to move the code right
- Shift + Tab => Select a block of code and hit "Shift + Tab" to move that block of code left.
- When using Linq, you can use object.Any(pass in an expression) just like you would use a Were Close to check whether the query does contain any data. This can be used when you want to be sure that the query will retrieve data.
- cw => will automatically write Console.Writeline() code If you are developing a Console Application