AddObject Method (key, value)

Microsoft Deployment Tools

Deployment Tools Foundation AddObject<(Of <(T>)>) Method (key, value)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerCustomActionDataAddObject<(Of <(T>)>)(String, T)
Adds a value to the data collection, using XML serialization to persist the object as a string.
Declaration Syntax
C# Visual Basic Visual C++
public void AddObject<T>(
	string key,
	T value
)
Public Sub AddObject(Of T) ( _
	key As String, _
	value As T _
)
public:
generic<typename T>
void AddObject(
	String^ key, 
	T value
)
Generic Template Parameters
T
Parameters
key (String)
Case-sensitive data key.
value (T)
Data value (may be null).
Exceptions
Exception Condition
ArgumentException the key does not consist solely of letters, numbers, and the period, underscore, and space characters.
NotSupportedException The value type does not support XML serialization.
InvalidOperationException The value could not be serialized.

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller) Version: 3.0.0.0 (3.5.1623.0)