I have a .NET assembly for a COM-visible component that I want to use some configurations. I know that applications use the app.config, but is it a violation of best practices to create and use an app.config for my assembly??
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
My understanding is that if when you build the assembly, you have an app.config file then it will be turned into assmeblyName.dll.config by the compiler. If this present in the same directory as the assmebly at runtime, then it will be loaded whenever you try and read app.config. This explains it a bit clearer.
I see it as being a sensible way of partitioning the configuration data so that the data relevant to the assembly is kept with the assmebly.
EDIT This technique applies to appSettings, not sure if other data in app.config can be shared in the same way.