weixin_39528843
weixin_39528843
2020-12-27 22:26

Move some WebHostBuilderExtensions to Hosting.Abstractions

IISIntegration was able to depend just on Hosting.Abstractions until it called CaptureStartupErrors.

Move extensions that may be used by extensions from other packages and not just app code. E.g: - UseConfiguration - CaptureStartupErrors - UseEnvironment - UseUrls - Start

Don't move: - UseStartup - UseDefaultHostingConfiguration - UseServer? - What if I wanted a UseKestrel extension? - UseContentRoot - UseWebRoot

https://github.com/aspnet/Hosting/blob/dev/src/Microsoft.AspNetCore.Hosting/WebHostBuilderExtensions.cs

该提问来源于开源项目:aspnet/Hosting

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39780255 weixin_39780255 4月前

    I'm confused. Why webroot is not the configuration that comes with StaticFiles? It looks to me that only the StaticFile module is interested in setting the dir where it would find files to serve.

    点赞 评论 复制链接分享
  • weixin_39729837 weixin_39729837 4月前

    StaticFiles and MVC use the webroot folder by default for serving files. It's in hosting because it flows via the IHostingEnvironment service.

    点赞 评论 复制链接分享
  • weixin_39780255 weixin_39780255 4月前

    Thanks, , when does MVC need webroot folder to serve files? I'm under the impression this should be done by StaticFiles.

    点赞 评论 复制链接分享
  • weixin_39729837 weixin_39729837 4月前

    https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Core/VirtualFileResult.cs#L148

    点赞 评论 复制链接分享
  • weixin_39780255 weixin_39780255 4月前

    Oh I see. It's in the core. Thank you very much!

    点赞 评论 复制链接分享
  • weixin_39729837 weixin_39729837 4月前

    Why not move everything that can be moved?

    点赞 评论 复制链接分享
  • weixin_39528843 weixin_39528843 4月前

    Doesn't matter, as long as it doesn't require too much implementation code or any dependencies.

    点赞 评论 复制链接分享

相关推荐