Class ComponentVersionException
- Namespace
- KeenEyes.Serialization
- Assembly
- KeenEyes.Core.dll
Exception thrown when a component version mismatch is detected during deserialization.
public class ComponentVersionException : InvalidOperationException, ISerializable
- Inheritance
-
ComponentVersionException
- Implements
- Inherited Members
Remarks
This exception is thrown when:
- The serialized data contains a newer version of a component than the current runtime version. This typically means the save file was created with a newer version of the application.
- A component migration is required but no migration path is available.
For cases where the serialized version is older than the current version, the migration pipeline will attempt to automatically migrate the data to the current version.
Constructors
ComponentVersionException(string, int, int)
Initializes a new instance of the ComponentVersionException class.
public ComponentVersionException(string componentName, int serializedVersion, int currentVersion)
Parameters
componentNamestringThe name of the component that had a version mismatch.
serializedVersionintThe version of the component that was serialized.
currentVersionintThe current version of the component in the runtime.
ComponentVersionException(string, int, int, Exception)
Initializes a new instance of the ComponentVersionException class.
public ComponentVersionException(string componentName, int serializedVersion, int currentVersion, Exception innerException)
Parameters
componentNamestringThe name of the component that had a version mismatch.
serializedVersionintThe version of the component that was serialized.
currentVersionintThe current version of the component in the runtime.
innerExceptionExceptionThe exception that is the cause of the current exception.
ComponentVersionException(string, int, int, string)
Initializes a new instance of the ComponentVersionException class.
public ComponentVersionException(string componentName, int serializedVersion, int currentVersion, string message)
Parameters
componentNamestringThe name of the component that had a version mismatch.
serializedVersionintThe version of the component that was serialized.
currentVersionintThe current version of the component in the runtime.
messagestringA custom error message.
Properties
ComponentName
Gets the name of the component that had a version mismatch.
public string ComponentName { get; }
Property Value
CurrentVersion
Gets the current version of the component in the runtime.
public int CurrentVersion { get; }
Property Value
SerializedVersion
Gets the version of the component that was serialized.
public int SerializedVersion { get; }