Visual studio code exe not working

Not R1oT 1 Reputation point
2022-10-16T11:27:52.407+00:00

Hello dear people of the internet.I have come here seek some help.Basically when i try to build and run my C code in VS it works but the exe won't open for some reason.And if I try to open the exe through the folder on the desktop it opens for a milisecond and closes.Is there a solution to this issue?

Developer technologies | Visual Studio | Debugging
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,686 Reputation points Microsoft External Staff
    2022-10-17T04:43:31.693+00:00

    Hi @Not R1oT ,

    Welcome to Microsoft Q&A forum.

    I agree with @David Lowndes , and I believe you are developing a console application. The console application is different from other kind of projects, it cannot be started directly by double-clicking it(otherwise it will open and run and then close automatically and immediately). If you want to run it and keep it displaying, you can open a Command Prompt like CMD and call to run it. See following screenshot:

    250906-image.png

    Or just running it in the Visual Studio.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.