ReSharper 2016.3 Help

Code Generation

ReSharper provides a variety of ways to generate boilerplate code. For example, you can use undeclared code symbols and automatically generate these symbols based on usages, generate type members, and more.

If the design-time code inspection is enabled in the current file, ReSharper detects missing members and suggests the corresponding quick-fixes for implementing missing members:

Code Generation command in the action list

A lot of ways to generate code is also provided with Context Actions and Code Templates.

In this section:

You can control how new code is generated in two major ways:

  • Configure various aspects of code style (e.g. naming style, formatting rules, etc.) ReSharper will enforce its requirements when generating code.
  • For generating type members, you can choose default body content for generated members. One of the three options - NotImplementedException(), returning default value, and non-compilable code - can be selected on the Code Editing | Members Generation page of ReSharper options.

Most of ReSharper's code generation features are available in C# and Visual Basic .NET , some are available in several languages, others are language-specific. The table below lists all code generation features and languages/technologies where they are supported.

The instructions and examples given in the topics within this section address the use of code generation features in C#. For more information on code generation features available for specific languages, see the corresponding topics in the ReSharper by Language section.

C# VB.NET C++ HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts Protobuf JSON
Generate Code from Usage /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generating Code with Code Completion /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Constructors /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Properties/(Getters and Setters) /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Implementing/Overriding Members /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Delegating Members /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Dispose Pattern /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Partial Methods /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Hash Function /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Equality Members /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Relational Members /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Equality Comparer /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Relational Comparer /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Formatting Members /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Event Subscriptions /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Definitions /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Copy and move operations /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Relational operations /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Stream output operator /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Swap function /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg
Generate Content for Placeholders /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/check.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg /help/img/dotnet/2016.3/cross.svg

See Also

Last modified: 3 April 2017