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

System.Text.Json SG is run twice in WPF projects #10175

Open
ZzZombo opened this issue Dec 13, 2024 · 1 comment
Open

System.Text.Json SG is run twice in WPF projects #10175

ZzZombo opened this issue Dec 13, 2024 · 1 comment
Assignees
Labels
Investigate Requires further investigation by the WPF team.

Comments

@ZzZombo
Copy link

ZzZombo commented Dec 13, 2024

Description

Similar to dotnet/extensions#4969, the SG is included twice in a compilation, resulting in duplicate definition errors and build failure due to the way WPF is built, involving a temporary project.

Reproduction Steps

  • Start a new WPF project.
  • Create a SG-enabled JSON serialization context, the target type and options do not matter, it should just be minimally functional.
  • Try to build. The Output pane lists the errors twice, once for the temporary project and once, verbatim, for the actual one.

Expected behavior

SG is included only once.

Actual behavior

SG is included twice and prevents the build from finishing successfully.

Regression?

I can't say, sorry. There was one other issue previously but because of two SGs being active at once.

Known Workarounds

I can't say, unless switching back to reflection is considered one.

Configuration

I target net9-windows on Windows 10 x64. It shouldn't be specific to that configuration but I don't know for sure.

Other information

AS I said already, it shows up twice in output, once per each project in the compilation, even though IMO the temp. WPF project shouldn't run the JSON SG at all, so preventing it from running in either when building a WPF application should fix the issue.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

@ViktorHofer ViktorHofer transferred this issue from dotnet/runtime Dec 13, 2024
@himgoyalmicro himgoyalmicro added Investigate Requires further investigation by the WPF team. and removed Untriaged labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team.
Projects
None yet
Development

No branches or pull requests

3 participants