.net core虚拟目录配置

.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")
});

posted @ 2018-07-06 11:26  bububu。  阅读(2914)  评论(0编辑  收藏  举报