Skip to content

.NET 8 dotnet-user-jwts does not support JSON files with comments in them #55557

@EmperorArthur

Description

@EmperorArthur

Backport Request

Per @martincostello this was fixed for .NET 9, but has not yet been backported to .NET 8.

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The tool dotnet-user-jwts does not work if appsettings.Development.json has any comments "//" in it.
This is different from the behavior of ApplicationBuilder.

Expected Behavior

dotnet-user-jwts can parse any file which is considered valid by IconfigurationBuilder.AddJsonFile(...).

Steps To Reproduce

Add a comment line "//" to appsettings.Development.json, then run dotnet user-jwts create

Exceptions (if any)

'/' is invalid after a value. Expected either ',', '}', or ']'.

.NET Version

8.0.204

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIfeature-userjwtsThe `dotnet user-jwts` CLI tool

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions