in asp.net 5 is it possible to store and read custom files in approot instead of wwwroot?

前端 未结 2 1631
渐次进展
渐次进展 2021-02-14 11:02

when you deploy an asp.net5/mvc6 app there is the wwwroot folder where web assets like css, js, images belong, and there is approot folder where packages and source code belong.

2条回答
  •  旧巷少年郎
    2021-02-14 11:12

    Yes, it is possible. Just get the path to your app folder and the pass it to configuration or whoever else needs it:

    public class Startup
    {
        public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
        {
            var wwwrootRoot = env.WebRootPath;
            var appRoot = appEnv.ApplicationBasePath;
    

提交回复
热议问题