I am having trouble writing a file to the response stream (sandbox solution).
The final line of this code block throws a null reference exception.
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("content-disposition",
String.Format("attachment;filename={0}", "performance.xlsx"));
HttpContext.Current.Response.ContentType =
"application/vnd.openxmlformats officedocument.spreadsheetml.sheet";
memStream.WriteTo(HttpContext.Current.Response.OutputStream);
HttpContext.Current.Response.End() (This line);
This works fine on a normal ASP.NET app.