Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScriptCS 0.17.01 Error Unexpected named argument

I tried to run my program using Visual Studio's Coderunner extension as well as from terminal with the scriptcs command.

My code is as follows:

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

The error message reads:

Unexpected named argument: Users/jfitz/Projects/C#/Projtest/test.cs
like image 553
jamesfdearborn Avatar asked Oct 29 '25 03:10

jamesfdearborn


1 Answers

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

In the meantime, pending the 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 in the comments:

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

"code-runner.executorMap": { "csharp": "scriptcs -script" }
like image 163
VonC Avatar answered Oct 31 '25 18:10

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!