TeamCity Cloud 2024.12 Help

Inspections (ReSharper)

The Inspections (ReSharper) build runner allows you to use the benefits of the JetBrains ReSharper code quality analysis feature right in TeamCity, with the help of the bundled JetBrains ReSharper Command Line Tools. You can use the tools within TeamCity without any additional ReSharper license.
ReSharper analyzes your C#, VB.NET, XAML, XML, ASP.NET, ASP.NET MVC, JavaScript, HTML, CSS code, and allows you to:

  • Find probable bugs

  • Eliminate errors and code smells

  • Detect performance issues

  • Improve the code structure and maintainability

  • Ensure the code conforms to guidelines, standards and specifications

ReSharper command line tools 2018.2 or newer require .NET Framework 4.6.1 or newer.

You can also refer to the ReSharper documentation for more details.

Refer to Configuring Build Steps for a description of common build steps' settings. Refer to Container Wrapper to learn how you can run this step inside a Docker container.

Sources to Analyze

Option

Description

Solution file path

The path to the .sln file created by Microsoft Visual Studio 2005 or later.
The specified path should be relative to the checkout directory.

Projects filter

Specify project name wildcards to analyze only a part of the solution. Leave blank to analyze the whole solution. Separate wildcards with new lines.
Example:

JetBrains.CommandLine.* *.Common *.Tests.*

Environment Requirements

Option

Description

Target Frameworks

This option allows you to handle the Visual Studio Multi-Targeting feature.
Agent requirement will be created for every checked item.

.NET Framework versions 2.0–4.8.1 are supported.

JetBrains ReSharper Command Line Tools Settings

Option

Description

R# CLT Home Directory

Select the ReSharper Command Line Tools version.

Check the version of installed Resharper tools

R# CLT Plugins

The list of additional ReSharper plugins to install. This field accepts values in the pluginID/version format, for example: StyleCop.StyleCop/2023.2.0.

  • pluginIDs can be found on main plugin pages in JetBrains Marketplace (the "Additional Information" section of the "Overview" tab).

  • version should be in the same format as on the "Versions" tab of the plugin Marketplace page. Omitting the version allows ReSharper to automatically fetch the latest.

If you want to install plugins from local storage rather than download it from a JetBrains Marketplace, set the Additional InspectCode parameters field to the --source=<Directory_Path> value.

Install plugins from local storage

Note that the --source parameter affects all plugins, so you cannot mix Marketplace downloads and local storage installs.

InspectCode Platform

Select the platform bitness of the InspectCode tool. To find code issues in C++ projects, use the x86 platform. The cross-platform inspections are also supported in ReSharper 2020.2.1 or later.

InspectCode Options

Option

Description

Custom settings profile path

The path to the file containing ReSharper settings created with JetBrains ReSharper 6.1 or later.
The specified path should be relative to the checkout directory.
If specified, this settings layer has the top priority, so it overrides ReSharper build-in settings. By default, build-in ReSharper settings layers are applied.

For additional information about the ReSharper settings system, see ReSharper Web Help and JetBrains .NET Tools Blog

Enable debug output

Check this option to include debug messages in the build log and publish the file with additional logs (dotnet-tools-inspectcode.log) as a hidden artifact.

Additional inspectCode.exe arguments

Specify newline-separated command line parameters to add to calling inspectCode.exe.

Build Failure Conditions

If a build has too many inspection errors or warnings, you can configure it to fail by setting a build failure condition.

Build before analyze

In order to have adequate inspections' execution results, you may need to build your solution before running analysis. This pre-step is especially actual when you use (implicitly or explicitly) code generation in your project.

Bundled ReSharper Versions

TeamCity Version

ReSharper Version

2018.1

2018.1.2

2018.2

2018.1.4

2019.1

2019.1.1

2019.2

2019.2.3

2020.1

2019.2.3

2020.2

2020.2.4

2021.1

2021.1.2

2021.2

2021.1.2

2022.04

2021.1.2

2022.10

2021.1.2

2023.05

2021.1.2

2023.11

2023.1.1

You can view the installed versions of ReSharper on the Server Administration | Tools page. The bundled version is set as default; you can install other versions and change the default settings.

Last modified: 03 November 2024