命令
AppDomain.CurrentDomain.BaseDirectory
测试
using System; using System.Web.Mvc; using Abp.Web.Mvc.Authorization; using Castle.Core.Logging; namespace YinLongWebSite.Web.Controllers { [AbpMvcAuthorize] public class HomeController : YinLongWebSiteControllerBase { public ActionResult Index() { Logger.Debug(AppDomain.CurrentDomain.BaseDirectory); return View(); } } }
输出
DEBUG 2020-07-18 10:54:02,506 [7 ] ngWebSite.Web.Controllers.HomeController - D:IIS网站Publish