Configure on a Connected Azure DevOps Server using a YAML Pipeline

  • 3 minutes to read

Sign in to Azure Pipelines

  1. Click the Azure DevOps logo to open the Projects page.


  2. Select an existing project for your organization and click the Pipelines icon.


Create a New Pipeline

  1. Choose New pipeline in the Pipelines page.


  2. Select the location of your source code in the Connect wizard page.


  3. Select a repository.


  4. Choose a template.


  5. Add the CodeRush Server task after the Build solution (VSBuild@1) task in the azure-pipelines.yml file. Use the following YAML:

- task: CRServerTask@201
    solution: '**/*.sln'   

The result is shown below:


  1. Click Save and run to commit a new azure-pipelines.yml file to your repository and run the build.


  2. Click Save and run to confirm this commit.



You can use a self-hosted build agent. The CodeRush Server task requires you install the Visual Studio Build Tools and .NET Framework 4.7.2 on a build agent. When installing Visual Studio Build Tools, make sure you select the ".NET Core build tools" item in a list of toolsets to be installed. The Code Coverage feature requires installation of Microsoft Visual C++ 2015 Redistributable.

Configure the CodeRush Server Task

Locate the CRServerTask task in the azure-pipelines.yml file and click the Settings link to access the task settings.


You can specify the following options:

Solution or Project Option

This option allows you to specify a relative path to the repository root of the project or solution to run. Wildcards can be used but the result must point to a single file.


Configuration Option

Leave the configuration set to "Debug" (or set it to another configuration that can be used to run unit tests).


Send Logs Option

Enable the "Help DevExpress improve this product by sharing usage data anonymously" option if you want CodeRush Server to collect logs. This helps us improve this product. No personal information is collected (see Privacy Policy).


Exclude Tests in Categories Option

Set the Exclude tests in categories option to "TODO | Exclude". This option allows you to ignore tests by category. Excluded tests are marked as ignored on the Tests view page.


Exclude Projects and Assemblies from Analysis

Use the RunSettings file location option to specify a relative path to a .runsettings file. Wildcards may be used. CodeRush Server excludes projects and functions from code coverage analysis if you add them to the corresponding Exclude section of the .runsettings file.

Use the Assemblies excluded from analysis option to specify relative paths to assemblies, or assembly names, which you want to exclude from testing and analysis. Wildcards may be used.


Click Add to add the CodeRush Server task changes to the yaml file.


Another way to customize the CodeRush Server task in the azure-pipelines.yml file is to replace the existing CRServerTask with the following:

- task: CRServerTask@201
    solution: '**/*.sln'
    sendLogs: true
    excludeCategories: 'TODO | Exclude'
    runsettings: 'Project.runsettings'
    excludeprojects: |

Build Configuration Option

Assign the "Debug" value to the buildConfiguration option in the azure-pipelines.yml file.


Save and Run

  1. Click Save to confirm the commit.


  2. Run the pipeline.


  3. Track the build until it is completed.


View Analysis Results

Click CodeRush to view analysis results on Dashboard, Tests, Coverage, and Diagnostics views after the solution is built.