Docs Menu
Docs Home
/
MongoDB C# Analyzer

Analyze Your Code

On this page

  • Overview
  • Use the MongoDB C# Analyzer From the Command Line

Learn how to use the C# Analyzer to analyze your MongoDB .NET/C# driver code. The C# Analyzer can analyze expressions created with the following patterns:

  • Builders Class

  • Language Integrated Query (LINQ)

  • Plain Old CLR/Class Objects (POCOs)

To run the C# Analyzer from the command line and save your results to a SARIF format file, perform the following actions:

  • Install the C# Analyzer as described in the Install guide.

  • Execute the following command:

dotnet build -property:ErrorLog=<Path to save your C# Analyzer report>

To learn more about dotnet build, see .NET Fundamentals from Microsoft.

To learn more about the ErrorLog setting, see Error and Warning Options from Microsoft.

Back

Installation