.net core在iis上配置虚拟目录不起作用,只需要将app.UseStaticFiles中物理路径PhysicalFileProvider改为指定的路径即可,如:E:\\Html\\News

 

app.UseStaticFiles(new StaticFileOptions()

{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), "E:\\Html\\News"),
RequestPath = new PathString("Static")
});

相关文章:

  • 2022-01-01
  • 2021-11-30
  • 2021-11-04
  • 2021-10-23
  • 2021-11-05
猜你喜欢
  • 2018-06-21
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
相关资源
相似解决方案