stride3d/stride · error · SerializationException
Invald ContentStorageHeader version.
Error message
Invald ContentStorageHeader version.
What it means
ContentStorageHeader.Read throws this when the version field in the header of an asset storage stream does not match any version the deserializer knows how to read. It guards against loading storage files written by incompatible (usually newer or corrupt) Stride versions. Note the message text contains a typo ('Invald') in some versions even though nameof is used elsewhere.
Solutions
- Regenerate or re-export the storage file with a Stride version compatible with the reading code.
- Update the Stride.Core.Serialization package/runtime to a version that supports the file's header version.
- Verify the file is not truncated or corrupted (compare file size/hash with the source).
Example fix
// before
var header = ContentStorageHeader.Read(stream); // throws on unknown version
// after
if (!ContentStorageHeader.TryRead(stream, out var header))
throw new InvalidOperationException("Unsupported or corrupt storage header"); Defensive patterns
Strategy: validation
Validate before calling
// check magic/version before parsing
if (!stream.CanRead) throw new IOException("stream not readable");
var start = stream.Position;
if (!ContentStorageHeader.TryRead(stream, out var header))
throw new InvalidOperationException("Unsupported storage header version");
stream.Position = start; Try / catch
try { var h = ContentStorageHeader.Read(stream); }
catch (SerializationException ex) { /* unsupported version: regenerate file or upgrade runtime */ log.Error(ex); } Prevention
- Keep the reading runtime at the same or newer version than the tool that wrote the file
- Validate file integrity (size/hash) before reading
- Wrap storage reads in version-compatibility checks
When it happens
Trigger: Calling ContentStorageHeader.Read on a stream whose first bytes encode a version number outside the supported set of header versions.
Common situations: Opening a Stride package/asset storage file produced by a newer Stride editor; a truncated or corrupted storage file where garbage bytes are read as the version; mixing files between incompatible Stride releases.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Aliases are not supported in JSON
- Asset of type has been serialized with newer version , but…
- Asset of type should be updated from version to , but no…
- At least one profile must be specified.
- Attributes can not be null
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/38091e91abee2765.
Report an issue: GitHub.
Appendix: source
Thrown at sources/core/Stride.Core.Serialization/Streaming/ContentStorageHeader.cs:105
var version = stream.ReadInt32();
if (version == 1)
{
result.InitialImage = stream.ReadBoolean();
result.DataUrl = stream.ReadString();
result.PackageTime = new DateTime(stream.ReadInt64());
int chunksCount = stream.ReadInt32();
result.Chunks = new ChunkEntry[chunksCount];
for (int i = 0; i < chunksCount; i++)
{
result.Chunks[i].Location = stream.ReadInt32();
result.Chunks[i].Size = stream.ReadInt32();
}
result.HashCode = stream.ReadInt32();
return;
}
throw new SerializationException($"Invald {nameof(ContentStorageHeader)} version.");
}
}
View on GitHub (pinned to 96fad776d2)