【发布时间】:2018-02-15 15:43:40
【问题描述】:
在 ASP.NET Core MVC 应用程序中,我尝试通过返回 FileResult 来下载文件
public FileResult Download()
{
var fileName = $"DM.jpg";
var filepath = $"download/{fileName}";
byte[] fileBytes = System.IO.File.ReadAllBytes(filepath);
return File(fileBytes, "application/x-msdownload", fileName);
}
它在 localhost 上运行良好,但是当我在 Azure 上发布应用程序时,它无法运行并显示“处理您的请求时发生错误”。 我怎么知道错误是什么?
【问题讨论】:
标签: c# azure asp.net-core-mvc-2.0