System.AddIn.Pipeline.LifetimeTokenHandle renamed to ContractHandle
System.AddIn.Pipeline.LifetimeTokenHandle renamed to ContractHandle
I am playing with the new System.AddIn capabilities that are part of the .Net Framework 3.5, and finding it great. I have developed a smart client application in the past that had to face the dynamic loading of modules and seeing the new API and the problems this technology solves - I am very happy to get started with it.
I started by reading the two introductory articles in MSDN Magazine: .NET Application Extensibility - Part 1 and .NET Application Extensibility - Part 2, by Jack Gudenkauf and Jesse Kaplan.
In those articles, the samples project is an extensible calculator that loads add-ins using the new API. When trying to play with this samples project in Visual Studio 2008 Beta 2, it won't compile, since the class System.AddIn.Pipeline.LifetimeTokenHandle renamed to ContractHandle.
Just replace the following code (in CalculatorContractToViewHostAdapter.cs):
[System.AddIn.Pipeline.HostAdapterAttribute()]
public class CalculatorContractToViewHostAdapter : CalculatorContractsHAV.Calculator {
private CalculatorContracts.ICalculatorContract _contract;
private System.AddIn.Pipeline.LifetimeTokenHandle _handle;
public CalculatorContractToViewHostAdapter(CalculatorContracts.ICalculatorContract contract) {
_contract = contract;
_handle = new System.AddIn.Pipeline.LifetimeTokenHandle(contract);
}
...
}
To this code:
[System.AddIn.Pipeline.HostAdapterAttribute()]
public class CalculatorContractToViewHostAdapter : CalculatorContractsHAV.Calculator {
private CalculatorContracts.ICalculatorContract _contract;
private System.AddIn.Pipeline.ContractHandle _handle;
public CalculatorContractToViewHostAdapter(CalculatorContracts.ICalculatorContract contract) {
_contract = contract;
_handle = new System.AddIn.Pipeline.ContractHandle(contract);
}
...
}
Enjoy!