I have an Outlook Addin which does some processing of the Outlook mailboxes. On processing an email it fires an MailProcessed Event, if it couldn't process the email it fires MailProcessFail Event.
Now I have an external service which is running. It calls the add-in every 60 seconds to start processing the emails. It needs to listen to the custom events fired from the Add In and then take action.
Now I have tried implementing this with a simple c# Event, but when it gets to the following code
this.OutLookPlugin.MailProcessed += this.MailProcessSuccess;
It throws the following Exception. ArgumentException: value does not fall within the expected range.
Has anyone managed to throw a custom event from within an Outlook addin and listen to it from an external service?