i need to Check Whether the assembly is already running in the process when i start the same assembly ( to avoid duplication in assemblies running currently)
i need one copy of assembly to run at a time.. is there any property to set or how to check
i need to Check Whether the assembly is already running in the process when i start the same assembly ( to avoid duplication in assemblies running currently)
i need one copy of assembly to run at a time.. is there any property to set or how to check
check assembly
shiraz.inam
Where is the suitable place for inserting the code.. in new or.. when
Thnks.
Ovidiu Burlacu
Sergio.Rykov
armansiu
dakota367
if its an executable assembly, your app, you can get the list of processes by name and if it already exists then you know that another instance is running:
Dim theProcesses() as Process = System.Diagnostics.Process.GetProcessByName("yourAppName")
if theProcesses.Length > 1 then
'another process running
end if
Kartit
In Visual studio 2005, in the project settings, under the application tab there is a check box, "Make single instance application" that ensures that at any time there is only one instance of that application running on your machine. You can then also click on the "View application events", select "My application events" and select "StartupNextInstance" if you want to do any special processing if another instance tries to start (it won't, but it will notify the original one that it tried through this event.)
Was that what you needed
Alex
Mike Hadlow