-
-
Notifications
You must be signed in to change notification settings - Fork 273
Closed
Description
Hey there, there's a very unusual issue with the Roslynator CLI whereby it reports CS0121
on valid .NET 9 code.
Simply create a new C# console application and replace the main program code with the following:
namespace Example;
internal class Program
{
static void Main()
{
var text = string.Join(',', ["a", "b", "c"]);
Console.WriteLine(text);
}
}
Visual Studio shows no warnings:
The application builds:
~\source\Example via .NET v9.0.102 π― net9.0 took 4s
π [ 04:03:53 PM ] β― dotnet build
Restore complete (0.5s)
Example succeeded (2.8s) β bin\Debug\net9.0\Example.dll
Build succeeded in 3.6s
But the Roslynator CLI reports CS0121:
~\source\Example via .NET v9.0.102 π― net9.0
π [ 04:03:40 PM ] β― roslynator.exe analyze .\Example.sln
Loading solution 'C:\Users\Fots\source\Example\Example.sln'...
Analyze solution 'C:\Users\Fots\source\Example\Example.sln'
Analyze 'Example' 1/1
Program.cs(7,27): error CS0121: The call is ambiguous between the following methods or properties: 'string.Join(char, params ReadOnlySpan<object?>)' and 'string.Join(char, params ReadOnlySpan<string?>)'
Analyzed solution 'C:\Users\Fots\source\Example\Example.sln' (in 2.7 s)
1 CS0121
1 diagnostic found
Thanks heaps in advance!
Fotis