Skip to content

[Bug]: Playwright fails in trimmed .NET 10 publish due to reflection-based serialization #3260

@nikosdaridis

Description

@nikosdaridis

Version

1.56.0

Steps to reproduce

  1. Clone my repo at https://github.com/nikosdaridis/hattrick-transfers-scraper
  2. Publish to folder self-contained with Trim unused code enabled
  3. Run the published executable

Expected behavior

Playwright should launch browser and work normally even in a trimmed .NET 10 publish.

Actual behavior

[FTL] Fatal error: System.InvalidOperationException: Reflection-based serialization has been disabled for this application. Either use the source generator APIs or explicitly configure the 'JsonSerializerOptions.TypeInfoResolver' property.

Additional context

No response

Environment

- Operating System: Windows 11
- CPU: x64
- Browser: [All, Chromium, Firefox, WebKit]
- .NET Version 10.0.x (trimmed publish)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions