I kept getting errors in my log file that messageconfig file not found. It turned out that my application was expecting it in the bin\debug folder. What causes the application to expect so? It seems that when project is built it should copy the config file in bin\debug folder. Am i missing a certain project setting?
App/web.Config files are expected to be in the same directory as the application/web root.
Other, referenced config files may be in other directories, as specified in the main configuration file.
If you right click on the .config
file, then on properties
there is a Copy to Ouput Directory
entry.
This should be set to either Copy if Newer
or Copy always
, if this is set to Do not copy
, the .config
will not by copied to the debug/release folder where it is expected.
Config files are expected to be in the same location as the executing assembly.
Check out this SO question: .NET 2.0 Application Settings (user.config) file location
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