You may want to use global mutex.
Threading in C# has a nice example (copied below for convenience) on how to use named mutex to enusure only one instance of an application can run on a machine.
You can expand this example to ensure there is only one instance of an object as well.
class OneAtATimePlease {
// Use a name unique to the application (eg include your company URL)
static Mutex mutex = new Mutex (false, "oreilly.com OneAtATimeDemo");
static void Main() {
// Wait 5 seconds if contended – in case another instance
// of the program is in the process of shutting down.
if (!mutex.WaitOne (TimeSpan.FromSeconds (5), false)) {
Console.WriteLine ("Another instance of the app is running. Bye!");
return;
}
try {
Console.WriteLine ("Running - press Enter to exit");
Console.ReadLine();
}
finally { mutex.ReleaseMutex(); }
}
}
There is one more thing you may need to pay attention.
When using named mutex on a server that is running in terminal services, a named mutex can have two level of visibility, Global to all the sessions (name prefixed with "Global\
") or Local to the terminal server session (name prefixed with "Local\
", it will be default if no prefix is specified).
You can find more details on Mutex in MSDN: Mutex Class.