For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
MongoDB Branding Shape
Click here >
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.