I am working on a Outlook addin in which I want to send the data from one outlook addin project to another outlook project. But when I try call the function of another project with the object type data in the arguments it will throw "Unable to cast object of type 'System.Runtime.Remoting.Proxies.__TransparentProxy' to type at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)" error.
Here is the code for your reference.
public IProfileAttribute[] profileAttributes= null;
Outlook.Application outlookApp = new Outlook.Application();
this.profileAttributes = new FilingNotifiableIpmlementation().FilingNotification(); // to fill the object
object destAddinName = "Tikit.CarpeDiem.AddIn.Outlook";
Office.COMAddIn destAddIn = outlookApp.COMAddIns.Item(ref destAddinName)
destAddIn.Object.FilingNotification(this.profileAttributes);
FilingNotification() is the method which we want to call of Tikit.CarpeDiem.AddIn.Outlook this project and this.profileAttributes is the object array.
The flow is going perfectly to the Outlook project if the parameter type is either string or int but it is throwing error if the parameter is object type.
Implementation of FilingNotification() method in Tikit.CarpeDiem.AddIn.Outlook project.
public void FilingNotification(IProfileAttribute[] profileAttributesList)
{
if (profileAttributesList != null)
{
var x = profileAttributesList;
}
else
{
string y = "Try again";
}
}
Can someone help me in this one. I am stuck in this for 2 days. It will be really helpful. Thanks in advance.