Debug an “EXE” file using Visual Studio

Recently, while dealing with some nasty issues related Widows 11 Snipping Tool recording, an interesting visitor said something like “while debugging snipping tool” & it caught my attention! So I did a quick research and realized that I can use VS(Visual Studio) to open an EXE file and do the “debugging”! So let us see how this “debugging” works. Please note, this is not as in you are going to fix anything yourself, instead the whole process gives you an idea about what is going wrong.

We will use “Snipping Tool” for this exercise. Start Snipping Tool and keep it minimized. From the Task manager, let us see where is the physical location for the executable.

Use the “Copy as path” for getting the whole path for the executable.

Open up Visual Studio, I am using Visual Studio 2019 Community edition.

Once the file opened, you will see a screen like below

Now, we need to attach this opened EXE with a running process. Click on the “Attach…” button now, that will open up a window with currently running processes.

Now go back to your application. In our case, “Snipping Tool” and try to do a screen recording.

My current setup doesn’t work for Snipping Tool screen recording and the above error display doesn’t tell the user what went wrong. Windows Event Viewer is not much help either in this case of Snipping Tool. So, let us go back to Visual Studio and see whether we can get more information about the exception.

Now, we know what went wrong, right? Interested to fix it? Well, I think we are at the mercy of Microsoft to fix such issues with their application. According to the visitor, the failing call is due to the intel driver and he has created a Microsoft Feedback entry already listing them.

So, this is one of the most inexpensive ways to understand why a particular EXE is failing & as as I stated in the beginning of the article, not truly “debugging” as in debugging. Hope, you enjoyed this article!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.