I have a console application project and library project (dll) in one solution. The library project has app.config file where I store a connection string to database. The console application references this dll.
When I compile the console application and deploy it with the library I am not able to access the app.config file that belongs the dll when I need to change the connection string after the application is deployed.
This are the files that I see, but not .config file:
Where did I go wrong?
By default, there is only 1 ".config" file for a running application. It is the ".config" file associated with the EXE that started the program. You should probably copy the config values from the DLL's config file into the console app's config file. If you really want to keep them separate then you can't use the default ConfigurationSettings.AppSettings dictionary. See this question for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With