Closed ddaspit closed 8 years ago
Oh man good catch. I wonder why no one noticed this before. Everything was fine in my tests way back when I was using the configurator tool. I need to verify this first.
I think this was introduced in another PR which enabled custom destinations and renamed connection to destination. Can you verify this works as intended now (i.e. create basic mail destination and test it with the test button). If so I'll merge this.
I have tested this on my application and it now works properly. This probably went unnoticed because the bug only occurs when using an app.config (i.e. MyProduct.exe.config inside the same folder with the main executable 'MyProduct.exe'). In this case, the "LoadAppconfigSettings()" method is called, which tries to use "NBug.Properties.Settings" class to get the configuration settings. This fails, because the name of the destination properties don't match what has been configured in the "Settings.settings" file. When you use the test app in the configurator, it calls the "LoadCustomSettings()" method, which doesn't have this problem, since it reads the config file directly and doesn't care what the names of the destination properties are.
Alright, I must admit I've only tested with the test app and never with the *.exe.config
. Thanks for the detailed explanation. Will run more detailed tests after big PRs changing destinations etc. next time.
Merging.
Currently, connection strings for destinations are saved in "add" elements with names prefixed with "NBug.Properties.Settings.Connection". This does not match the settings configured in NBug.Properties.Settings, so if NBug attempts to load an "app.config", it will not load the destinations properly. This commit changes the Settings class so it saves destination connnection strings with the prefix "NBug.Properties.Settings.Destination", which does match.