Overview
Learn how to configure the C# Analyzer in your .NET project and what configuration options are available.
Configuration
To configure the C# Analyzer, perform the following actions:
Install the C# Analyzer as described in the installation guide.
Create a file specifying your configuration for the C# Analyzer named
mongodb.analyzer.json.Important
Naming
You must name your configuration file
mongodb.analyzer.json.Add your configuration to your
mongodb.analyzer.jsonfile.The following sample configuration disables variable tracking:
{ "EnableVariableTracking": "false" } Add the following to the
.csprojfile for your .NET application within theProjecttag:<ItemGroup> <AdditionalFiles Include="<path to your mongodb.analyzer.json file>" /> </ItemGroup>
Note
Configuration is Optional
If you do not specify a configuration file, the C# Analyzer uses the default value for all configuration options.
To learn more about .NET project files, see Understanding the Project File from Microsoft.
To learn more about the AdditionalFiles tag, see Using Additional Files in the Roslyn documentation.
Options
The following is a description of all configuration options supported by the C# Analyzer:
Name | Description | ||
|---|---|---|---|
EnableVariableTracking | Type: boolean TipTo learn more about builder expressions, see the Analyze Your Code page. Accepted Values: | ||
LogFileName | Type: string ImportantTo output logs, you must specify both a logfile and the Use the following sample configuration to make the C# Analyzer output information to a logfile: Accepted Values: A valid file path | ||
LinqAnalysisVerbosity | Type: string
ImportantThe Accepted Values: | ||
OutputDriverVersion | Type: boolean | ||
OutputInternalExceptions | Type: boolean | ||
OutputInternalLogsToFile | Type: boolean ImportantTo output logs, you must specify both a logfile and the Use the following sample configuration to make the C# Analyzer output information to a logfile: Accepted Values: | ||
PocoAnalysisVerbosity | Type: string
Accepted Values: | ||
SendTelemetry | Type: boolean TipTo learn more about telemetry in the C# Analyzer, see the Telemetry section of this guide. Accepted Values: |
To learn more about the configuration options the C# Analyzer supports, see the MongoDB C# Analyzer source code.
Telemetry
When the C# Analyzer analyzes your source code, the tool by default collects and sends anonymized information to MongoDB Inc. to improve products.
To disable this feature, specify the following option in your configuration file:
"SendTelemetry": false
To view a complete list of all information collected by the C# Analyzer when you have enabled telemetry, see the FAQ page.
To learn more about how MongoDB Inc. uses collected data, see the Privacy Policy.