Can I create .config file and include it to web.config? How can i do this?
UPD. If you want to separate config file, for example, move appSettings to another file you must do next: In web.config
<appSettings configSource="myAppSettings.config" />
In myAppSettings.config:
<appSettings> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> </appSettings>
Answers. later you can access the file path using: string filePath = ConfigurationManager. AppSettings["Path"].
A configuration file, often shortened to config file, defines the parameters, options, settings and preferences applied to operating systems (OSes), infrastructure devices and applications in an IT context. Software and hardware devices can be profoundly complex, supporting myriad options and parameters.
web. config file is an XML-based configuration file used in ASP. NET-based applications to manage various settings that are concerned with the configuration of our website. In this way, we can separate our application logic from configuration logic.
It is not entirely clear what you want to do, but all configuration sections can be stored in a separate files and be referenced by the main .config
file using the configSource
property.
See this blog post for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With