Assembly reload crashes when two different components on the same entity have identically named properties of different types
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.2.1.2442
Platform(s): Microsoft Windows 11 Pro 10.0.26100 x64
Describe the bug
Assigning an audio asset to a property on a custom EntityComponent causes Game Studio to crash during assembly reload. The crash happens while serializing the live object graph: UrlReference (and also Sound) is handled as if it were IIdentifiable, leading to an InvalidCastException. Game Studio closes as a result.
To Reproduce
- Create custom EntityComponent with UrlReference component.
- Attach the component to an entity in a scene/prefab.
- In Game Studio, assign any .xksnd audio asset to the property.
- Make a trivial code change and build (which triggers assembly reload).
- Game Studio crashes.
Expected behavior
It should be possible to use audio assets as properties on EntityComponents. Assigning a sound (via UrlReference or Sound) should survive assembly reload without crashing, and the assigned value should remain serialized/restored.
Log and callstacks
InvalidCastException: Unable to cast object of type
'Stride.Core.Serialization.UrlReference`1[Stride.Audio.Sound]'
to type 'Stride.Core.IIdentifiable'.
at Stride.Core.Assets.Serializers.IdentifiableObjectSerializer...
at Stride.Assets.Presentation.AssemblyReloading.GameStudioAssemblyReloader...
Additional context
It does not matter whether the property type is Stride.Audio.Sound or UrlReference — both configurations crash Game Studio on assembly reload after assigning a value in the editor.
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 InvalidCastException path through Stride.Core.Assets.Serializers.IdentifiableObjectSerializer and Stride.Assets.Presentation.AssemblyReloading.GameStudioAssemblyReloader. Reproduce with UrlReference or Sound on an EntityComponent, assign an audio asset, and trigger assembly reload; done when the editor no longer crashes and the assigned value remains serialized and restored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100