Last post Sep 21, 2012 11:58 AM by VorlonShadow
Sep 21, 2012 11:43 AM|VorlonShadow|LINK
I posted a message here which was deleted stating that it does not belong in this forum, but I have searched the web already and cannot find the answer to the solution, and cannot find a forum that might be able to answer my question. I feel like this is
the only forum I can add this to because it is a configuration issue, it deals with the app.config file. Instead of deleting the message, if you can suggest the appropriate forum, I will gladly re-post. My message was as follows:
I have written a small console app that performs a certain function, and I have used the app.config file to store settings. These settings are different on my local develop machine than they will be when deployed to the server. When I upload the app to the
server then change the settings in the app.config file, the app on the server does not see the changes to app.config on the server. However, if I make the changes to app.config on my local machine as they would be on the server, then re-compile the app, then
copy that to the server, it works fine. Why would I need to compile the settings file, that makes having a configuration file a total moot point, doesn't it? I might as well hard-code the settings into the app code.
Is there some way to circumvent this issue? Some other way to store configuration settings that I can change once on the server?
Sep 21, 2012 11:46 AM|AidyF|LINK
You might not be aware, but your console app doesn't read the app.config file, it is only called that on your development environment. When you compile the app, the app.config is renamed to yourappname.exe.config and copied into the relevant debug or release
folder, and that is the file the app reads. If you want to change settings on the fly on your production server then update the ".exe.config" version, putting an app.config file on your production server will do nothing as it isn't read.
Sep 21, 2012 11:58 AM|VorlonShadow|LINK
That was it. Thank you very much for the response, that definitely helped.