Related to my previous question on this matter, where the file was not being produced, the file returned by the following code is now empty. My controller action is declared as follows, then has a body that generates CSV lines from records for export. The CSV generation works.
[Authorize(Order = 0, Roles = "Requester,Controller,Installer")]
public FileStreamResult ExportJobCards()
In the following code that should return a populated CSV file, lines
is of type List<string>
and has 126 items. sw.BaseStream
has the value 770048 for both its Length and Position properties. A zero byte file is returned to the browser, however.