0

I have two .NET Winform applications (A and B) inherited from WindowsFormsApplicationBase which are developed on same framework.

In the Main class code if I set IsSingleInstance = False, it runs A and B simultaneously but it can also run multiple instances of A (or B) simultaneously. I have to avoid running more than one instance of A or B at same time.

Any ideas?

Arpit Khandelwal
  • 1,743
  • 3
  • 23
  • 34

2 Answers2

0

if you use a named Mutex instead of IsSingleInstance you have complete control over which apps start - see http://www.yoda.arachsys.com/csharp/faq/#one.application.instance for an overview and What is a good pattern for using a Global Mutex in C#? for a detailed example.

Community
  • 1
  • 1
stuartd
  • 70,509
  • 14
  • 132
  • 163
0

Just change the provide the executable assembly with a new GUID.

In Visual Studio, you can set the GUID in 'Assembly Imformation...' dialog available in 'Application' tab of the Project proerties.

Trainee4Life
  • 2,203
  • 2
  • 22
  • 38