Docs Menu

Analyze Your Code

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:

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.