Skip to content

0 ms is displayed for all analyzers under Analyzer Summary when using incompatible culture  #687

@Korexio

Description

@Korexio

Found in version: 2.1.820

Steps to reproduce:

Use the 'en-US' culture:

Set-Culture 'en-US'

Create a new example project:

dotnet new console

Enable code analysis, build the example project and generate a msbuild.binlog file:

dotnet build -bl -p:ReportAnalyzer=true -p:AnalysisLevel=latest-all

Open the msbuild.binlog file in MSBuild Structured Log Viewer using the 'de-AT' culture:

Set-Culture 'de-AT'
./msbuild.binlog

Expected

Correct execution time is displayed for all analyzers under Analyzer Summary.

Actual

0 ms is displayed for all analyzers under Analyzer Summary.

Cause

No NumberFormat/CultureInfo is specified in Microsoft.Build.Logging.StructuredLogger.CscTaskAnalyzer.AnalyzerAssemblyData.FromFolder > ParseLine when parsing the execution time.

Workaround

Use Set-Culture 'en-US' or something similar before starting MSBuild Structured Log Viewer.

Suggested Fix

Use the culture (CurrentUICulture?) value from the log file to parse the execution time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions