Does a Stream get Disposed when returning a File from an Action? [duplicate]
问题 This question already has answers here : Does FileStreamResult close Stream? (1 answer) How do I dispose my filestream when implementing a file download in ASP.NET? (2 answers) Closed 2 years ago . I'm writing a string to a MemoryStream I need to return the stream to the Controller Action so I can send it off as a file for download. Normally, I wrap the Stream in a using statement, but, in this case, I need to return it. Does it still get Disposed after I return it? Or do I need to dispose it