Question regarding App.Config for class library and logging
I have a class library for which i want to have configuration file.
The purpose of the configuration file is to have the path and other parameters.
Also i wanted to use the Enterprise logging block in Class library.
Here is my scenario:
- This is a Class library and will be deployed in GAC
- Enterprise logging blocks uses app.Config.
- My calling appl开发者_StackOverflow社区ication which consumes the dll is BizTalk 2010.
- I don't have permission to modify the BizTalk's application config file
What i am trying to achieve is:
- My Dll needs to use a configuration file which has many configuration parameters
- Also as i understand, I need app.config for Enterprise Logging
How can i achieve this? Any ideas?
Cheers, Karthik
The easiest way is to use the machine config. You also have the option to put your configuration in a separate file and then reference it from the machine config.
You can also set the values in code but that sorta defeats the purpose of using a config file to begin with.
Modify your class library to open and read config file from specific location.
Do you have access to the calling application's code?
If so, maybe you can explicitly load the config file as suggested by Marc_s's solution?
Just an idea.
精彩评论