I would like to create a semaphore in my app, where the creation will fail (with a clear exception), if another instance of the app is running and has already created the semaphore. So only one per server.
I'd like the limit of only one to hold across the system, not just the CLR. But I do not want it to hold across multiple servers (or VMs). i.e. I want the app able to run on 2 distinct servers.
Is this possible? If so, how?
thanks - dave