Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item.Save throws exception on derived class #91

Open
nathandace opened this issue Jun 17, 2016 · 0 comments
Open

Item.Save throws exception on derived class #91

nathandace opened this issue Jun 17, 2016 · 0 comments

Comments

@nathandace
Copy link

nathandace commented Jun 17, 2016

I have class that is derived from EmailMessage, so that I can inject some logic into the EmailMessage.SendAndSaveCopy().

However, Save() and SendAndSaveCopy() fail when called from the derived class due to an XML serialization error:

The empty string '' is not a valid local name.

Looking into the source code, this is because ServiceObjectDefinitionAttribute is missing from the derived class. Because this attribute is internal, I cannot add the attribute to my derived class to get past the XML serialization error.

My derived class is fairly straightforward, which demonstrates the exception that is thrown when calling base.SendAndSaveCopy()

public class CustomerEmailMessage : EmailMessage
{
     public CustomerEmailMessage(ExchangeService service) : base(service){}

     public new void SendAndSaveCopy(){
     {
          if (isEnabled)
          {
               base.SendAndSaveCopy();
          }
     }
}
@nathandace nathandace changed the title Item.Save failed on derived class Item.Save throws exception on derived class Jun 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant