Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it good design to have a separate config file for a dll?

Is it good design to have a separate config file for you dll?

I noticed when the dll is invoked from the application, it doesn't read it.

what the dll is able to read is the machine.config file.

like image 258
abhi Avatar asked Dec 17 '22 23:12

abhi


2 Answers

Making a dll dependent on a config file is not ideal and can become a real pain when you start unit testing or moving it about.

A better solution is pass any values from config settings in from the calling application e.g. WebApp or Windows App etc. and store any settings required in the app or web config.

like image 154
Alex Avatar answered Feb 22 '23 21:02

Alex


It looks like you have two separate questions.

  1. The users of your program aren't going to think in terms of configuring both your application and any associated DLLs. It seems to me that having a separate config file for a DLL might be confusing for users. It's not bad design to have a separate config file, but it's not necessarily good design either.

  2. DLLs certainly can read files. Check that the DLL is reading the file from the correct location (check the current working directory, for example).

like image 32
Greg Hewgill Avatar answered Feb 22 '23 21:02

Greg Hewgill