【发布时间】:2016-03-18 19:09:53
【问题描述】:
在我的 Azure Web App Web API 应用程序之一中,我在 Get 方法中使用此代码创建临时文件
string path = Path.GetTempFileName();
// do some writing on this file. then read
var fileStream = File.OpenRead(path);
// then returning this stream as a HttpResponseMessage response
我的问题是,在这样的托管环境中(不是在 VM 中),我需要自己清除那些临时文件吗? Azure 本身不应该清除那些临时文件吗?
【问题讨论】:
-
是的,就像 Windows 应该清理 TEMP 文件夹.. 你知道.. 因为它被称为 TEMP.. 但我不认为微软拥有字典,所以它是永久的垃圾存储。
标签: azure asp.net-web-api garbage-collection azure-web-app-service temporary-files