【发布时间】:2011-12-24 13:24:21
【问题描述】:
我需要在我的 Web 应用程序中获取当前配置的实例。我发现我可以通过以下方式获得它:
Configuration configuration = WebConfigurationManager.OpenWebConfiguration( HttpContext.Current.Request.ApplicationPath);
但是在我的项目的某些部分我没有 HttpContext 所以我需要在不使用 HttpContext 的情况下获取配置的实例。
【问题讨论】:
标签: c# configuration web-config