ActionResult DownloadFile In debug mode after download file app exit with error (Asp.Net MVC)

-1

I have controller which return file and after download file (in debug mode), iis.exe exit with code -1.

This is my controller

public class DownloadController : Controller
    {
        // GET: Download
        public ActionResult Index()
        {
            return View();
        }

    public ActionResult DownloadFF()
    {
        var pathToTheFile = Server.MapPath("~/Content/materials/test.txt");
        return File(pathToTheFile, MimeMapping.GetMimeMapping(pathToTheFile), "text.txt");
    }

    public FilePathResult DownloadTestFPR()
    {
        var pathToTheFile = Server.MapPath("~/Content/materials/test.txt");
        return File(pathToTheFile, MimeMapping.GetMimeMapping(pathToTheFile), "text.txt");
    }
}

If I use DownloadFileFF or DownloadTestFPR I got same result.

The program '[11124] iisexpress.exe' has exited with code -1 (0xffffffff).

I don't know if it is normal behavior, but without debug mode, after download file my mvc app is still running.

Questions are:

  • are my controller actions ok?
  • Why on debug mode iis.exe stop working?
  • It is ok ignore it, when without debug mode it looks like run without problem?

maybe this info help, maybe not, I working under VisualStudio 2017 CE v15.9.14

asp.net-mvc
downloadfile
asked on Stack Overflow Aug 24, 2019 by Wanderer • edited Sep 27, 2019 by tereško

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0