Refactoring in Visual Studio

Visual Studio 2015
 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Code Generation in Visual Studio.

Refactoring is the process of modifying code in order to make it easier to maintain, understand, and extend, but without changing its behavior. Some common refactorings include:

  1. splitting long functions into smaller ones

  2. renaming variables, types, functions or parameters

  3. reordering parameters

  4. removing or reordering using directives

Because the logic of refactoring is closely tied to language syntax, each language service in Visual Studio provides its own refactoring capabilities. For more information, see the following pages:

Refactoring in C#

Refactoring (C#)

Refactoring in Visual Basic

Refactoring and Rename Dialog Box (Visual Basic)

Refactoring in C++

Writing and refactoring code (C++)

Refactoring in F#

Refactoring support for F# is provided in Visual F# Power Tools, a third-party Visual Studio extension.

Visual Studio IDE
Writing Code in the Code and Text Editor

Show: