Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 IIS 中托管了 ASP.net Core 应用程序,我在 wwwroot\images 文件夹中添加了一个虚拟目录。但我无法访问文件夹中的内容。谁能帮我?我需要在多个 ASP.net Core 站点之间共享图像,所以我尝试使用虚拟目录。
几周前我遇到了同样的问题。如果您的项目是跨平台的,您需要使用如下虚拟文件夹:
app.UseFileServer(new FileServerOptions() { FileProvider = new PhysicalFileProvider(@"D:\files"), RequestPath = new PathString("/files"), EnableDirectoryBrowsing = false // you make this true or false. });
在 iis 中设置将不起作用