Weird bug with using System.Text.Json for extended classes directly in projects with the Stride3d nuggets.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 4.1.0.1948 (Migrated from 4.1.0.1898 and is also present in this version)
Platform(s): Windows
Describe the bug
Ok, i don't know exactly what happend but apparently if you use the System.Text.Json library for make custom extension classes directly in a project than happended to have some of the nuggets of Stride3d, it will manifest this error.
I just added some classes than actually work in other projects and i don't do anything fancy for trying to fix it either, this classes work in that other project because they are added through a .Net (.NET 6) Class library project, because of this the bug apparently start when the classes are added directly to a project than have the nuggets of Stride3d added to it, up to this moment i don't know which one(s) in specific.
I do know this because i also add them to a new clean project just created and the problem persist, because they were added directly, that will also explain why the other original project work like a charm and doesn't have this issue.
I do believe is something with the System.Text.Json in relation with some of the nuggets of stride3d.
Some symptoms:
- It doesn't run the project if you run it from VS showing an error
- The error doesn't seems to be from code, or at least doesn't show anything code related.
- It doesn't allow to open the project in GameStudio.
To Reproduce
Steps to reproduce the behavior:
- Add some custom extension converter classes to a project than on itself contains the tipical nuggets present in any stride3d project.
- Run it -or- try to open it in the GameEditor
here you can see and download an example project afflicted by this, if you preffer: https://github.com/JoseJohnen/RampAndMapExperiment/tree/can-be-corrected
Expected behavior
Run the project -or- Open in the GameEditor
Screenshots
Log and callstacks
Nothing besides the images
Additional context
UPDATE: For some reason, if i just remove the classes and then re-add them one by one running the application after every re addition seems to fix the issue, but this fix is just temporary because if you update afterwards to the last version (4.1.0.1948) OR try to open it with GameStudio, GameStudio will crash the very same moment you reload the code if it even loaded the solution at all.
You could use the remove and readd trick to make it run again in VS but you will not be able to open GameStudio or will crash the very moment you reload the code on it.
Also, consider this bug is found without the need to mess with the nuggets, feel free to correct me at this point if the solution is somewhere there, but if that is the case please let me know the solution because the temporal fix is just too unstable, and i don't think having to rely on the need to make an external class library every time you want to make at least one custom converter class for System.Text.Json is something you guys consider good or working as intended.
The code in the branch (the example code) is an example project than have this glitch, so you can see it with your own eyes and tinker with it if you preffer, or you can reproduce following the steps.
Thanks for your time
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked RampAndMapExperiment can-be-corrected branch and reproduce the failure using the listed steps, comparing classes added directly with those in a .NET 6 class library. Review the Visual Studio and GameStudio error screenshots, then isolate which Stride nugget interaction causes the failure. Done means the example project runs from Visual Studio and opens in GameStudio without crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100