C# ScriptCS 0.17.01错误意外的命名参数
我尝试使用VisualStudio的Coderunner扩展以及使用scriptcs命令从终端运行我的程序 我的代码如下:C# ScriptCS 0.17.01错误意外的命名参数,c#,visual-studio-code,scriptcs,vscode-code-runner,C#,Visual Studio Code,Scriptcs,Vscode Code Runner,我尝试使用VisualStudio的Coderunner扩展以及使用scriptcs命令从终端运行我的程序 我的代码如下: using System; namespace HelloWorldApplication { class HelloWorld { static void Main(string[] args) { Console.WriteLine("hellowol"); } } } 错误消息如下: Unexpected named argument: Us
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错误,将在下一版本中修复(和)
在此期间,在进行调查之前:
解决方法如下:
而不是做
mono scriptcs.exe /path/to/foo.csx
做:
建议:
对于Visual Studio代码,将其添加到settings.json
:
"code-runner.executorMap": { "csharp": "scriptcs -script" }
会有帮助吗?如果是os,我会在今天晚些时候发布答案。成功!感谢@VonC.For Visual Studio代码将此添加到
settings.json
的“Code runner.executomap”:{“csharp”:“scriptcs-script”}
@jonas谢谢。我在回答中加入了您的评论以提高可视性。请注意,在debian(我假设大多数linux系统)中需要花费一些时间。文件位于~/.config/Code/User
"code-runner.executorMap": { "csharp": "scriptcs -script" }