Arjang What is the recommended way in WPF to ensure single instance apps?
This <http://social.msdn.microsoft.com/Forums/en/wpf/thread/f26de29b-3381-440e-90 54-59d32e4a0c92> suggests (Jan 2011) that WPF does not have "a native way" of creating a single instance application - and that "This is a major fail" (of WPF design). Really? In that link discussion, the code used references the Microsoft.VisualBasic assembly and (SingleInstanceManager :) WindowsFormsApplicationBase. (Actually, it seems simple enough to me, but the discussion is about application crashes for some indefinable reasons). Here <http://blogs.microsoft.co.il/blogs/arik/archive/2010/05/28/wpf-single-insta nce-application.aspx> is another suggested way to do it (blog, from May 2010). Actually, this approach has been described for a few years - though the blog suggests Microsoft will/has released some "WPF reference samples" using it. Mutex, Remoting (sounds familiar?) Actually, I will use a different approach where the single application spawns separate threaded processes, which means the question I asked is theoretical rather than practical - but for my own education I'd still like to research different approaches. ________________________________ Ian Thomas Victoria Park, Western Australia -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Arjang Assadi Sent: Thursday, December 29, 2011 10:25 PM To: ozDotNet Subject: Re: Switching between single- and multiple-instance (WinForms) WPF or WinForms? On 29 December 2011 20:47, Ian Thomas <[email protected]> wrote: > Visual Basic projects can be very easily made single instance (Make Single > Instance Application property for the project), but I'd like a simple way to > change single instance behaviour to multiple-instance (in the same way that > many text editors allow it as a configuration - eg, TextPad). > > What is recommended? (either language) > > ________________________________ > > Ian Thomas > Victoria Park, Western Australia
