更新时间:2023-10-01 23:35:52
I tested this code snippet and it works for me from this sample project.
app.UseFileServer(new FileServerOptions()
{
RequestPath = new PathString("/foo"),
FileSystem = new PhysicalFileSystem(@".\web"),
});
确保您的web.config中包含此文件:
Make sure you have this in your web.config:
<system.webServer>
...
<modules runAllManagedModulesForAllRequests="true"></modules>
...
</system.webServer>