Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet] Avoid serializing to JSON in ToString() methods. #14741

Closed
RenderMichael opened this issue Nov 10, 2024 · 2 comments · Fixed by #14736
Closed

[dotnet] Avoid serializing to JSON in ToString() methods. #14741

RenderMichael opened this issue Nov 10, 2024 · 2 comments · Fixed by #14736

Comments

@RenderMichael
Copy link
Contributor

Feature and motivation

There are a few types whose ToString() methods will serialize the contents into a JSON representation. This has some drawbacks

  • Performance: This operation is heaver than a ToString() method should be. This is especially noticeable when using the debugger display.
  • AOT: These methods are on types which contain open-typed object values, which is inherently not AOT-safe. This can throw exceptions in AOT scenarios, which ToString() methods should never do. Of less concern is the fact that, since the ToString() method is basically always rooted, these operations will never be trimmed away, and AOT programs may be larger than they need to be.

Each of the relevant types are strongly-typed dictionaries. For reference, the standard convention for dictionary types is to avoid overriding the ToString() method.

The following types are affected:

  • DriverOptions (the base class for all browser options types)
  • ReturnedCapabilities (internal class)
  • RemoteSessionSettings

Usage example

N/A

Copy link

@RenderMichael, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant