QuickDevGuide

Home › .NET Framework (Legacy & Enterprise)

Configuration: web.config & app.config — .NET Framework (Legacy & Enterprise)

.NET Framework apps read XML configuration: app.config (copied to MyApp.exe.config) for desktop/services, web.config for ASP.NET (hierarchical — subfolders can override). Section Holds <appSettings> key/value settings → ConfigurationManager.AppSettings["key"] <connectionStrings> DB connections → ConfigurationManager.ConnectionStrings["Shop"] <system.web> ASP.NET: compilation, authentication, custom errors, session, httpRuntime <system.webServer> IIS integrated pipeline: modules, handlers, rewrite, headers <system.serviceModel> WCF endpoints and bindings custom sections your own ConfigurationSection classes Environment-specific config Config transforms (Web.Release.config) rewrite values at publish time. Keep secrets out of source control with configSource/file= external files…

Key Takeaways