Skip to content

Updating to v7 causes C# language mismatch #268

@Piedone

Description

@Piedone

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 using System.Text.Json.Nodes.JObject. That method doesn't use params and I don't understand how the error is 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 #265 and .NET 10 and doesn't happen if the project targets .NET 10 (what it soon will have).

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