Share via


SqlSyncMetadataStoreSerializer.SerializeReplicaMetadata Method

Serializes, for the specified replica, the contents of a metadata storage service store to a destination file in a canonical format.

Namespace:  Microsoft.Synchronization.MetadataStorage
Assembly:  Microsoft.Synchronization.MetadataStorage (in Microsoft.Synchronization.MetadataStorage.dll)

Syntax

'Declaration
Public Overrides Sub SerializeReplicaMetadata ( _
    idFormats As SyncIdFormatGroup, _
    replicaId As SyncId, _
    serializedFilePath As String, _
    compatibilityLevel As CompatibilityLevel _
)
'Usage
Dim instance As SqlSyncMetadataStoreSerializer
Dim idFormats As SyncIdFormatGroup
Dim replicaId As SyncId
Dim serializedFilePath As String
Dim compatibilityLevel As CompatibilityLevel

instance.SerializeReplicaMetadata(idFormats, _
    replicaId, serializedFilePath, compatibilityLevel)
public override void SerializeReplicaMetadata(
    SyncIdFormatGroup idFormats,
    SyncId replicaId,
    string serializedFilePath,
    CompatibilityLevel compatibilityLevel
)
public:
virtual void SerializeReplicaMetadata(
    SyncIdFormatGroup^ idFormats, 
    SyncId^ replicaId, 
    String^ serializedFilePath, 
    CompatibilityLevel compatibilityLevel
) override
abstract SerializeReplicaMetadata : 
        idFormats:SyncIdFormatGroup * 
        replicaId:SyncId * 
        serializedFilePath:string * 
        compatibilityLevel:CompatibilityLevel -> unit 
override SerializeReplicaMetadata : 
        idFormats:SyncIdFormatGroup * 
        replicaId:SyncId * 
        serializedFilePath:string * 
        compatibilityLevel:CompatibilityLevel -> unit 
public override function SerializeReplicaMetadata(
    idFormats : SyncIdFormatGroup, 
    replicaId : SyncId, 
    serializedFilePath : String, 
    compatibilityLevel : CompatibilityLevel
)

Parameters

  • serializedFilePath
    Type: System.String
    The destination file to which metadata is serialized.
  • compatibilityLevel
    Type: Microsoft.Synchronization.CompatibilityLevel
    A CompatibilityLevel value that specifies for which version of Sync Framework the serialized metadata is valid. For example, if the native knowledge serialization format is Sync Framework 2.x, but the value provided for this parameter is Sync Framework 1.0, knowledge values are serialized in the 1.0 format. If knowledge values use any 2.x features that cannot be serialized in the 1.0 format, serialization throws an InvalidSerializationVersionException exception.

Exceptions

Exception Condition
ArgumentNullException

A required parameter is a null reference (Nothing in Visual Basic).

ArgumentException

serializedFilePath is an empty string; serializationVersion is a value other than SyncFrameworkVersion1 or WindowsSync.

SyncIdFormatMismatchException

The format of replicaId is not of the format specified by idFormats.

SyncInvalidOperationException

The metadata store is not open.

ExplicitTransactionRequiredException

A transaction is not available within which to serialize metadata.

Remarks

Two conditions must be met before this method is called:

Calling this method when either of these conditions is not met results in an exception.

See Also

Reference

SqlSyncMetadataStoreSerializer Class

Microsoft.Synchronization.MetadataStorage Namespace