Click or drag to resize
IVssBackupComponentsAddComponent Method
The AddComponent method is used to explicitly add to the backup set in the Backup Components Document all required components (nonselectable for backup components without a selectable for backup ancestor), and such optional (selectable for backup) components as the requester considers necessary. Members of component sets (components with a selectable for backup ancestor) are implicitly included in the backup set, but are not explicitly added to the Backup Components Document.

Namespace: Alphaleonis.Win32.Vss
Assembly: AlphaVSS.Common (in AlphaVSS.Common.dll) Version: 1.3.0.0 (1.3.0.0)
Syntax
void AddComponent(
	Guid instanceId,
	Guid writerId,
	VssComponentType componentType,
	string logicalPath,
	string componentName
)

Parameters

instanceId
Type: SystemGuid
Identifies a specific instance of a writer.
writerId
Type: SystemGuid
Writer class identifier.
componentType
Type: Alphaleonis.Win32.VssVssComponentType
Identifies the type of the component.
logicalPath
Type: SystemString

String containing the logical path of the selectable for backup component.

A logical path is not required when adding a component. Therefore, the value of this parameter can be .

There are no restrictions on the characters that can a logical path.

componentName
Type: SystemString

String containing the name of the selectable for backup component.

The value of this parameter cannot be nulL.

There are no restrictions on the characters that can appear in a logical path.

Exceptions
ExceptionCondition
ArgumentExceptionOne of the parameters is not valid.
OutOfMemoryExceptionOut of memory or other system resources.
SystemExceptionUnexpected VSS system error. The error code is logged in the event log.
VssBadStateExceptionThe backup components object is not initialized, this method has been called during a restore operation, or this method has not been called within the correct sequence.
VssInvalidXmlDocumentExceptionThe XML document is not valid. Check the event log for details.
VssObjectAlreadyExistsExceptionThe object is a duplicate. A component with the same logical path and component name already exists.
See Also