Scrutor
Scrutor copied to clipboard
Updating to v7 causes C# language mismatch
This is very strange, but this is what happens:
With Scrutor v6.1.0 everything is fine. After updating to v7.0.0 we get a build error from this line from a project using it:
error CS8652: The feature 'params collections' is currently in Preview and unsupported. To use Preview features, use the 'preview' language version.
See the build here.
Note the following:
- The
JObject.FromObject()call is just usingSystem.Text.Json.Nodes.JObject. That method doesn't. I don't understand how the error related to its signature:
public static JsonObject? FromObject(object? obj, JsonSerializerOptions? options = null)
- This is part of a larger solution, this one (other projects in it use Scrutor too).
- All projects in the solution target .NET 8 and use C# 12.
I suspect this related to https://github.com/khellang/Scrutor/pull/265 and .NET 10 and doesn't happen if the project targets .NET 10 (what it soon will have).