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

转载于:https://www.cnblogs.com/-clouds/p/9272682.html

你可能感兴趣的:(.net core虚拟目录配置)