나는 파일 역할을하는 동작이 있습니다파일 파일 결과를 찾을 수 없습니다
public ActionResult() GetFile
{
return this.File("C:\\test.txt", "text/plain",
"test.txt");
}
을하지만 작업이 오류가 발생합니다
FileNotFoundException: Could not find file: C:\test.txt Microsoft.AspNetCore.Mvc.Internal.VirtualFileResultExecutor+d__4.MoveNext()
내가 파일 exstis이 확신 - 그것이를 통해 열 수를 "실행"창 (Win + R). Asp.net 핵심 mvc가 파일을 "확인"하지 않는 이유는 무엇입니까? 당신이 볼 수 있듯이
public virtual VirtualFileResult File(string virtualPath, string contentType)
, 매개 변수의 이름이 virtualPath
입니다 :로
감사를 참조 - PhysicalFile 내가 찾고 있었던 것입니다. 어쨌든 - 이상한 예외. 더 많은 의미 - 전체 메시지 (f. 주어진 경로는 가상이 아닙니다.)) 도움이 될 수 있습니다 :) – pwas