Table of Contents

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

componentName string

The name of the component that had a version mismatch.

serializedVersion int

The version of the component that was serialized.

currentVersion int

The 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

componentName string

The name of the component that had a version mismatch.

serializedVersion int

The version of the component that was serialized.

currentVersion int

The current version of the component in the runtime.

innerException Exception

The 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

componentName string

The name of the component that had a version mismatch.

serializedVersion int

The version of the component that was serialized.

currentVersion int

The current version of the component in the runtime.

message string

A custom error message.

Properties

ComponentName

Gets the name of the component that had a version mismatch.

public string ComponentName { get; }

Property Value

string

CurrentVersion

Gets the current version of the component in the runtime.

public int CurrentVersion { get; }

Property Value

int

SerializedVersion

Gets the version of the component that was serialized.

public int SerializedVersion { get; }

Property Value

int