How to identify a process for an assembly?
-
29-10-2019 - |
Question
I have different assemblies and different processes each process will load few of assemblies from my bin. How do can we find which assembly belongs to which process?
Solution
This should do the trick
use this System.Diagnostics.Process.GetCurrentProcess().Id
if your exe's are windows forms put that process id in the window.Text
if your exe's are console apps put it in the console
You can find the process from task manager. Process Id column in task manager is not enabled by default so you can do by View Menu->Select Column
Select PID (Process Identifier) and press OK.Now process Id will appear in task manager and in task manger go to processes tab where you can find out exe is linked with what process
Also in Visual studio if you goto Debug -> Attach to process it lists out the process ID's