Why are you trying to set the identifier in the code? This is usually what you need to configure when the application is deployed and then left alone. If you can explain what you are trying to accomplish, we can offer a better way to do this.
Also, do you know that changing the web configuration will restart the application? All server-side caching will be reset, user sessions will end, etc. Just because a tool exists to modify web configuration from code does not mean that it is a good idea.
source share