Search code examples
c#visual-studiokilltaskmanager

How Can I found the process id of a console app in debug from visual studio?


I got a Visual Studio solution with a console project inside. When running in debug the console application it seems to run till it ends. But apparently, the corresponding *.exe is still in use, since it cannot be manually deleted from the bin folder. Not even after closing the Visual Studio.

The Console Application has a human-readable name like MyApplication.blabla.exe, but I cannot find it in the task manager.

Is there any way to find the id of that process so that I can do a kill of the process? or any way to identify which of the elements in the task manager is the one that actually is running MyApplication.blabla.exe?


Solution

  • After you can run this solution using Visual Studio:

    Debug => Attach to Process

    Then you need to search for the name of the exe on the opened page, as shown below:

    enter image description here

    Here you can see the Process ID of the exe