ScriptCS 0.17.01 错误意外的命名参数

ScriptCS 0.17.01 Error Unexpected named argument

我尝试 运行 我的程序使用 Visual Studio 的代码 运行ner 扩展以及从终端使用 scriptcs 命令。

我的代码如下:

using System;
namespace HelloWorldApplication {
class HelloWorld {
   static void Main(string[] args) {
      Console.WriteLine("hellowol");
   }
}
}

错误信息如下:

Unexpected named argument: Users/jfitz/Projects/C#/Projtest/test.cs

scriptcs/scriptcs issue 1188, this is from a scriptcs bug, which will be fixed in the next release (PR 1289 and commit 9e49b72)

所述

同时,等待 next 0.18 scriptcs release:

The workaround is the following:

instead of doing

mono scriptcs.exe /path/to/foo.csx

do:

mono scriptcs.exe -script /path/to/foo.csx

Jonas suggests :

For Visual Studio Code, add this to settings.json:

"code-runner.executorMap": { "csharp": "scriptcs -script" }