4

Is there a way to ensure that only a single instance of the desktop version of a trusted Silverlight 4 Out Of Browser app will run?

Or do I need to manually enforce this through the creation of a crude mutex of some sort?

If I must enforce this myself, I'd look at creating a file in isolated storage as a lock and then deleting it on exit. I'd check this files existence on launch to prevent opening a subsequent instance. Obviously I'd need a way to handle the app crashing or exiting some other way that prevents the lock file from being deleted. My instinct would be to have a timeout on the file and so ignore it if it's over a certain period of time old. Unfortunately, the app plays movies so it's likely it will run for several hours under normal circumstances. A lock timeout of a few hours isn't likely to be popular with any users in this situation. Are there any better solutions?

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143

0 Answers0