How to get the physical location of an ASP.NET web application without using HttpContext.Current?

前端 未结 2 1390
天涯浪人
天涯浪人 2020-12-10 17:19

I\'ve found myself having a requirement to configure log4net based on a file relative to the physical location of the running ASP.NET web application. We like to start the l

2条回答
  •  心在旅途
    2020-12-10 17:36

    Try HttpRuntime.AppDomainAppPath. For more info, read IIS7 Integrated mode: Request is not available in this context exception in Application_Start posted by Mike Volodarsky.

提交回复
热议问题