I need an app.config file to be used by an assembly at assembly initialization
How do I ensure that an app.config file 开发者_运维百科gets read on assembly initialization, for .Net 3.5-4 ?
It's a class library assembly. VS2008 provides a menu to add an app.config file, but it's ignored so far.
I need to use the app.config to provide information for logging from the assembly.
Thanks in advance!
A config
file will only be read by an executable, not a dll.
You need to add the config
to the executable that will use your dll.
If you have a test harness (Console app, nUnit test or anything like that), add the required configuration to it.
精彩评论