想不到默认的.net core竟然不支持静态文件,还需要额外配置中间件来支持
1.Nuget安装 Microsoft.aspnetcore.staticfiles
2.在Startup.cs中使用服务:
app.UseStaticFiles();
参考文档:
http://www.jb51.net/article/135436.htm
http://www.jb51.net/article/116369.htm
https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/static-files?tabs=aspnetcore2x
https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/middleware/index?tabs=aspnetcore2x