I am converting a .NET 4 console app to a DLL so I can then consume it from multiple consumers, services, console apps and so on.
However I ran into the problem that after I converted it to to a DLL the consumer app ran into bugs whenever it tried to access a value stored in the app.config file attached to the DLL.
Converting a C# Console App to a DLL
These are things like connection strings, paths to folders to store data and other important information.
I was told I could either -Put the config into the consumer app and pass all these options into the DLL as parameters to the methods (a lot of work to rebuild the DLL) -Use some form of XML file to store the values and then use a special method to get them out. Examples would be great! -Use Settings Files -Use some form of function (which I don't understand-not too hot on .NET yet) -Hardcode the values as strings, ints, nools etc in my DLL
The values in this config file won't change as they are related to the content of the DLL not the consumer app. So passing them in seems a lot of work when the DLL could just have them hardcoded in the first place.
Any tips AND examples would be greatly appreciated - I have read and searched for answers for this on this forum by the way before someone says "this has been answered many times" maybe just not in a way some new to DLLS and Consumer console apps would understand?
Thanks for any help!