Version Used: Microsoft.CodeAnalysis.CSharp.CodeStyle 4.0.1
The package doesn't load its own predefined globalconfig files on case sensitive file systems.
The package contains the following relevant files:
build
config
AnalysisLevelStyle_None.editorconfig
AnalysisLevelStyle_Recommended.editorconfig
AnalysisLevelStyle_All.editorconfig
AnalysisLevelStyle_Default.editorconfig
AnalysisLevelStyle_Minimum.editorconfig
Microsoft.CodeAnalysis.CSharp.CodeStyle.targets
Microsoft.CodeAnalysis.CSharp.CodeStyle.props"
The code in Microsoft.CodeAnalysis.CSharp.CodeStyle.targets that loads the config file, builds the path with ToLowerInvariant() and therefore doesn't load anything on case sensitive file systems, e.g. on Linux:
<_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle>AnalysisLevelStyle_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle).editorconfig</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle>
<_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle.ToLowerInvariant())</_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle>
Steps to Reproduce:
dotnet new globaljson --sdk-version 6.0.101
dotnet new web
dotnet add package Microsoft.CodeAnalysis.CSharp.CodeStyle --version 4.0.1
dotnet build -p:AnalysisLevelStyle=Recommended -p:AnalysisLevelSuffixStyle=Recommended
On Linux this incorrectly runs with no warnings:
dotnet build -p:AnalysisLevelStyle=Recommended -p:AnalysisLevelSuffixStyle=Recommended
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored /home/ubuntu/bug1/bug1.csproj (in 222 ms).
bug1 -> /home/ubuntu/bug1/bin/Debug/net6.0/bug1.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:03.42
On Windows the build has warnings, as expected:
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored [...]\bug1\bug1.csproj (in 298 ms).
[...]\bug1\Program.cs(1,1): warning IDE0008: Use explicit type instead of 'var' [[...]\bug1\bug1.csproj]
[...]\bug1\Program.cs(2,1): warning IDE0008: Use explicit type instead of 'var' [[...]\bug1\bug1.csproj]
bug1 -> [...]\bin\Debug\net6.0\bug1.dll
Build succeeded.
[...]\bug1\Program.cs(1,1): warning IDE0008: Use explicit type instead of 'var' [[...]\bug1\bug1.csproj]
[...]\bug1\Program.cs(2,1): warning IDE0008: Use explicit type instead of 'var' [[...]\bug1\bug1.csproj]
2 Warning(s)
0 Error(s)
Time Elapsed 00:00:02.41
Expected Behavior:
The package should correctly load the specified config file under Linux. Just like it does on Windows.
Actual Behavior:
The package does not load the config file under Linux.
Version Used: Microsoft.CodeAnalysis.CSharp.CodeStyle 4.0.1
The package doesn't load its own predefined globalconfig files on case sensitive file systems.
The package contains the following relevant files:
The code in
Microsoft.CodeAnalysis.CSharp.CodeStyle.targetsthat loads the config file, builds the path withToLowerInvariant()and therefore doesn't load anything on case sensitive file systems, e.g. on Linux:Steps to Reproduce:
dotnet new globaljson --sdk-version 6.0.101dotnet new webdotnet add package Microsoft.CodeAnalysis.CSharp.CodeStyle --version 4.0.1dotnet build -p:AnalysisLevelStyle=Recommended -p:AnalysisLevelSuffixStyle=RecommendedOn Linux this incorrectly runs with no warnings:
On Windows the build has warnings, as expected:
Expected Behavior:
The package should correctly load the specified config file under Linux. Just like it does on Windows.
Actual Behavior:
The package does not load the config file under Linux.