The .NET Framework add-in pipeline is a series of assemblies that that facilitate the exchange of data between a host application and an add-in. The host application uses the pipeline to discover and load an add-in. After an add-in is loaded, the add-in and the host application use the pipeline to call into each other and pass objects between each other. For example, an add-in might call methods in the host application to automate the application. Similarly, the host application might call methods in the add-in to use a service that is provided by the add-in.
The following illustration shows the pipeline.
Add-in pipeline
.png)
The host application is at one end of the pipeline and the add-in is at the other end. The pipeline is composed of three main kinds of assemblies:
In the middle is an assembly that defines a set of contracts. A contract is a non-versioning interface that defines the protocol for types to communicate across an isolation boundary, such as an application domain or a process. All contracts derive from the IContract interface.
Next to the host application and the add-in are assemblies that define a set of views. These are abstract classes or interfaces that define the methods that the host application and the add-in use to call into each other. Because the host application and the add-in access only the views, the other components in the pipeline can be changed without updating the host application or the add-in.
In between the contracts and the views are assemblies that define a set of adapters. These are classes that convert the data that is passed through a contract into types that are understood by the views used by the host application and the add-in. If an adapter converts data from a view to a contract, the adapter must implement the contract. If an adapter converts data from a contract to a view, it inherits or implements the view.
For a complete discussion of the pipeline, see Add-in Overview and Pipeline Development in the MSDN Library for Visual Studio 2008. For more information about the pipeline components, see Contracts, Views, and Adapters in the MSDN Library for Visual Studio 2008.
One of the key benefits of the add-in pipeline is that it enables applications to run add-ins in different application domains or processes. This is possible because all calls between the application and add-ins pass through a remotable adapter that implements a contract. This isolation helps to prevent add-ins from accidently or intentionally causing the host application to fail unexpectedly. For more information about isolation boundaries and how remotable objects can be used to communicate across them, see Boundaries: Processes and Application Domains and Remotable and Nonremotable Objects.