Vscode error "variable $(workspacefolder) cannot be resolved"

Logan 0 Reputation points

When i try to run a program in vscode it shows an error message which says "variable $(workspacefolder) cannot be resolved". But then when i try to run it in a different compiler, the program runs fine. I tried searching for the solution but can't find the exact solution. What should i do?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,573 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 27,106 Reputation points Microsoft Vendor

    Hello @Logan,

    Thank you for taking time to post this issue in the Microsoft Q&A forum.

    As VS Code is different from VS, please kindly post your question here: Github – vscode for further help.

    Thanks for your understanding, have a great day.

    Best Regards,


    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