简体   繁体   中英

Web service configuration storage

I have created simple web service MySrv using C# . Now I need to have some specific configuration data like paths, debug level for logging and others. For this reason I was thinking to have static class object called Config and load it's data to from ini file or database table. But when I looked to projects Class View I found interesting section called MySrv.Properties Probably this is place where I can store my configuration? Another interesting place for storing configuration is Web.config . Is it good manner to use this file for custom settings.

Which way is the nicest to store specific configuration data?

From my knowledge web.config will be the best option. You can add your config section in config file and this can be loaded to your custom class very easily. As it is XML, modifying settings will be simplified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM