It may be too early to tell, however, it seems as though changing from a FilePathResult
to a FileContentResult
has fixed the problem.
var fileBytes = System.IO.File.ReadAllBytes(fileInfo.FullName);
return new FileContentResult(fileBytes, "text/xml")
I'm not sure what FilePathResult ends up doing internally, but, reading the file with ReadAllBytes
seems to avoid the issue.