Web API 应用程序限制从本地物理路径访问文件

Web API application restricts to access the files from local physical path

使用我的本地 Web API 应用程序,我试图访问我系统的物理路径 (D:/FileExplorerContent/) 中可用的文件。但它会抛出以下错误消息。 "System.ArgumentException, 'D:/FileExplorerContent/' is not accessible. Access is denied." 我还提供了对该文件夹 (D:/FileExplorerContent/) 的完全权限。

仍然存在同样的问题。如果我尝试使用我的本地 MVC 应用程序访问 'D:/FileExplorerContent/' 目录中可用的相同文件,它工作正常。 我认为我的 Web API 应用程序仅限制访问本地物理路径 (D:/FileExplorerContent/) 中可用的文件。如何解决这个问题,请问有什么建议吗?

将 IIS_IUSRS 添加到该文件夹​​并设置权限。