skip to Main Content

I am trying to run a simple C# console app and I get the error: scriptcs: command not found.

In a question asked 5 years ago, the answer states to brew install scriptcs. The only problem is that when I attempted that, I got this error: scriptcs has been disabled because it is not maintained upstream!. My program works ok with the dotnet run command in the terminal, within VSCode, but not just with the run button.

Please how do I resolve this?

Thank You.

2

Answers


  1. if you use the Code Runner extension. reference this vidoe.

    open or create settings.json file in workspace folder, type code-runner, after select code-runner.executorMap option, and change "csharp": "scriptcs" to "csharp": "dotnet run", it was work for me.

    Login or Signup to reply.
  2. You’re probably using Code Runner extension, here’s the solution for this scenario:

    1. Access VS Code configuration using the shortcut: Ctrl + Shift + P or Shift + Cmd + P
    2. Look for settings.json
    3. Look for code-runner.executorMap and locate csharp
    4. Change "csharp": "scriptcs" to "csharp": "dotnet run"
    5. Save the settings file!!!
    6. Done!
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search