简体   繁体   中英

share configuration between console application and asp.net web application

I have a web.config file defined in my asp.net web application. I have many different settings configured there.

I have another project, this time a console application. I'd like to read several configurations from my web.config file. How can this be done?

Thank you

Check out this article.

Does exactly what you want.

Basically you "delegate" sections of your config file to another file.

In your case you would delegate sections of your config file in your console app, to read the settings from the web.config in your web app.

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