简体   繁体   中英

How to pass connection string to class library when consumed by quartz

I have written one quartz service which is deployed as windows service. This service consumes a class library which reads some files from file system and dump into database. When I tested this class library from a console application, it was working fine. But when it started consumed by quartz, I am getting error because it is not able to find connection string for database connection.How should I pass connection string to my class library.I kept it in its app.config. but still it is not working.

At a single moment application domain can consume settings from only one configuration file, all the others are ignored.

When you were running console application, your app.config was the only configuration file in domain, and it was used. However when you started using Quartz the library provided its own configuration file, and your own app.config became to be ignored.

The solution is to put your connection string in the Quartz config file.

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