Differences in behavior between System.Web.Configuration.WebConfigurationManager and System.Configuration.ConfigurationManager
问题 I had some trouble on a test server with an ASP.NET website. I goofed, and had the home directory of the Default Web Site pointed to the wrong place. When I tried: ConfigurationManager.ConnectionStrings["connectionString"]; it returned null, but using System.Web.Configuration; /* ... */ var rootWebConfig = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); rootWebConfig.ConnectionStrings