Hi,
I am trying to use App.config file in Server object extension that I am building. The app.config file does gets copied to the SOE (verified by renaming the .soe file to .zip file and checking the contents). But I am unable to read that app.config file.
I was wondering if you guys have come across similar issues.
Thanks!
I am trying to use App.config file in Server object extension that I am building. The app.config file does gets copied to the SOE (verified by renaming the .soe file to .zip file and checking the contents). But I am unable to read that app.config file.
I was wondering if you guys have come across similar issues.
Thanks!
Are you using System.Configuration?
do you have appSetting keys in the config file?
what happens when you try to read those keys?
what is the error?
Yes I am using System.configuration and other general ways you would try to read app.config. I am trying to read the app.config in my construct folder of the server object extension. However, it is not finding the app.config file and the keys and the values are appearing as null.
So, for SOE, how would you go about it if you want the flexibility of specifying parameters outside the dll or .soe file. I can use property but the requirement is to use config files.
I personally do not think that doing this is a good idea. Perhaps you could create your own XML configuration file and literally read it yourself. Just look in whatever directory your assembly is executing out of.
Thank you for the reply. I agree going with the first option is not a good idea.
I have even tried creating my own xml and reading it with no success. The xml does gets packaged in the soe (you can see it after changing .soe extension to .zip). However, it appears while executing it still doesn't read it. I am not aware of how the soe is exploded and where it is placed in ArcGIS Server - may be the dll gets seperated and gets loaded somewhere and that's why it is not able to find the app.config file (which is technically <dllName>.dll.config file.
Anand,
Have you got it working finally? I also have similar issue. Is there a way we can use the configuration file to read the parameters instead of setting properties in Contruct?
TIA
Yes, you can write similar code
your app.config
Thanks for your response Domenico.
Every change in the app.config has to be compiled and the modified .soe file has to be registered once again with ArcGIS server. I am trying to avoid registering the SOE again and again for every configuration change.
You could also set a connection to your db in costruct soe and get in a table your values configuration in methods soe so you change in table without register again .