I am wondering what would be the life time of a static variable in windows service. I have a windows service and static variable to save the messages flowing inside the service. will I get the messages saved on the static variable after the service is restarted?
Share
No, static variables will revert to their original values upon application restart, and a service restart is an application restart.