【问题标题】:ScriptCS 0.17.01 Error Unexpected named argumentScriptCS 0.17.01 错误意外的命名参数
【发布时间】:2018-08-20 05:30:53
【问题描述】:

我尝试使用 Visual Studio 的 Coderunner 扩展以及使用 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

【问题讨论】:

标签: c# visual-studio-code scriptcs vscode-code-runner


【解决方案1】:

正如scriptcs/scriptcs issue 1188 中提到的,这是一个脚本错误,将在下一个版本中修复(PR 1289commit 9e49b72

同时,等待next 0.18 scriptcs release

解决方法如下:

而不是做

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

做:

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

Jonas 建议in the comments

对于 Visual Studio Code,将其添加到 settings.json:

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

【讨论】:

  • 对于 Visual Studio Code 将此添加到 settings.json "code-runner.executorMap": { "csharp": "scriptcs -script" }
  • @jonas 谢谢。我已将您的评论包含在答案中以提高知名度。
  • 小记,我在 debian 中花了一些时间(我假设大多数 linux 系统)该文件位于 ~/.config/Code/User
猜你喜欢
  • 1970-01-01
  • 2019-08-29
  • 1970-01-01
  • 2022-01-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-09-08
相关资源
最近更新 更多