I'm having a very weird problem right now... I am trying to return a file from my web api but i'm getting a HTTP ERROR 500 even though the stream is working and no errors are thrown in the code.
var doc = DocX.Load(...);
// ...
var ms = new MemoryStream();
doc.SaveAs(ms);
doc.Dispose();
return File(ms, "application/octet-stream");
The stream becomes of size 22kb but when I navigate to the api's url I get a HTTP 500, why?
Thank you.