DynEntTech / CBKnownIssues

0 stars 0 forks source link

SDK, when you run SDK created programs, the app.config is copied to another location and used from there #4

Open davidonelson opened 3 years ago

davidonelson commented 3 years ago

This can easily result in you connecting to the wrong database and accidentally and incorrectly updating the production database.

When you run a SDK created program for the first time, the app.config in the folder with your EXE is silently copied to a new location, then used from that new location. This means, if you subsequently edit the connection string in the app.config in the folder where your EXE is located and run the program again, your new connection string will not be used and the connection string in the copy of the app.config will be used.

Prior to build 6921, the location the app.config is copied it is: C:\ProgramData\Connected Business\(FullVersionNumber)\(BinFolderName)\(ProgramName.exe.config)

Starting with build 6921, the location the app.config is copied to is: C:\Users\(user)\AppData\Roaming\(ProgramName)

If you are running the program under a windows system account, like Network Service, see here where the copy of the app.config is found:. https://serverfault.com/questions/9325/where-can-i-find-data-stored-by-a-windows-service-running-as-local-system-accou From my notes, under this path, could be under multiple folders: C:\Windows\System32\config\systemprofile\AppData\Roaming\Connected Business (search for *.config)

For example, if trying to change the sql server password for the email service, nothing indicates the copy of the .config file must be deleted first, so much time can be wasted trying to change the sql server password, for example. .