There are some problems with compiling 'using' statement in this action. You should remove all white spaces after 'using' statement. Look on example below

  • using (MemoryStream ms = new MemoryStream()) - invalid
  • using(MemoryStream ms = new MemoryStream()) - correct