通常,VS coder里我们都会使用code runner 插件直接方便的运行程序。
coder runner里运行C#需要安装scriptcs这个软件,链接如下
正常Mac下可使用brew按照,但该软件目前不支持M1芯片

因此,需要通过dotnet运行
设置code-runner.executorMap里的Csharp
"csharp": "cd $dir && dotnet run",
就这么简单就可以了。
[Running] scriptcs "/Users/gouff/Documents/study/s1/Program.cs"
/bin/sh: scriptcs: command not found
[Done] exited with code=127 in 0.005 seconds
[Running] cd "/Users/gouff/Documents/study/s1/" && dotnet run
Hello, World!
[Done] exited with code=0 in 1.018 seconds