AddInProcess Class

Provides an external process for running add-ins out-of-process from the host application.


Namespace:  System.AddIn.Hosting
Assembly:  System.AddIn (in System.AddIn.dll)

public sealed class AddInProcess

The AddInProcess type exposes the following members.

Public methodAddInProcess()Initializes a new instance of the AddInProcess class.
Public methodAddInProcess(Platform)Initializes a new instance of the AddInProcess class, specifying the bits-per-word of the process in which the add-in runs.

Public propertyIsCurrentProcessGets a value that indicates whether the current AddInProcess object represents the host application process.
Public propertyKeepAliveGets or sets a value that indicates whether to keep the external process alive.
Public propertyPlatformGets the bits-per-word of the process in which the out-of-process add-in is run.
Public propertyProcessIdGets the process ID of the external process.
Public propertyStartupTimeoutGets or sets the number of seconds to allow for the process to start.

Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodShutdownForcibly shuts down the external process.
Public methodStartStarts the external process.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Public eventShuttingDownOccurs when the process represented by the AddInProcess object is about to be shut down.

To activate an add-in in an external process, pass an AddInProcess object to the appropriate AddInToken.Activate<T>(AddInProcess, PermissionSet) method overload.

The executable that runs the add-in is obtained from one of two files installed with the .NET Framework under the Windows directory. By default, the executable that matches the bits-per-word of the host application is used. If the host is a 64-bit process, AddInProcess.exe is run; otherwise, AddInProcess32.exe is run. To specify the way the executable is selected, use the AddInProcess(Platform) constructor to create the AddInProcess object.

The following example activates an add-in in an external process.

// Create an external process.
AddInProcess pExternal = new AddInProcess();

// Activate an add-in in the external process
// with a full trust security level.
Calculator CalcAddIn4 =

// Show that the add-in is an an external process
// by verifying that it is not in the current (host's) process.
AddInController AddinCtl = AddInController.GetAddInController(CalcAddIn4);
Console.WriteLine("Add-in in host's process: {0}",

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft