Debugging an executable in visual studio

点点圈 提交于 2019-12-04 22:32:46
matra

You did not specify it in the question, but I assume you do not have the source code. Just use File/Open Project/Solution, select EXE file and Open it. Then select Debug/Start debugging. The other option is to run the EXE first and then Select Debug/Attach to process.

If what your asking is how do you attach VS to the exe you want to run then you can follow these steps:

  1. Run the executable
  2. In VS navigate to Debug -> Attached to Process
  3. Find your process created by running your executable and click "attach".

However, if the executable you are trying to run fails almost immediately or runs quickly and exits then you could try the following steps:

  1. Set a debug point at the start of the code
  2. Switch your build to Debug and run the application.

If your application is running in Debug, but failing when you execute the exe then you could try these steps to see if the your app will give more information in a console window or other.

  1. Make sure your build is set to Release.
  2. Navigate to Debug -> Start Without Debugging
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!