question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with scriptcs

See original GitHub issue

Hi @formulahendry

As mentioned in the readme I’ve installed the scriptcs extension and it works fine on the terminal for the *.csx scripts but it’s not the same with run code command in VsCode.


Console.WriteLine("Hello C#")

The above displays the expected output with scriptcs scratch.csx but inside VsCode it raises the following error


[Running] scriptcs "/Users/eklavya/Projects/Amsterdam/RosettaCode/scratch.csx"
Unexpected named argument: Users/eklavya/Projects/Amsterdam/RosettaCode/scratch.csx
Usage: scriptcs options

   OPTION                    DESCRIPTION                                                                                     
   -ScriptName (-script)     Script file name, must be specified first                                                       
   -Repl (-R)                Launch REPL mode when running script. To just launch REPL, simply omit the 'script' argument.   
   -Help (-?)                Displays help                                                                                   
   -Debug (-D)               Emits PDB symbols allowing for attaching a Visual Studio debugger                               
   -Cache (-C)               Flag which determines whether to run in memory or from a .dll                                   
   -LogLevel (-log)          Flag which defines the log level used.                                                          
   -Install (-i)             Installs and restores packages which are specified in packages.config                           
   -Global (-g)              Installs and restores global packages which are specified in packages.config                    
   -Save (-S)                Creates a packages.config file based on the packages directory                                  
   -Clean (-Cl)              Cleans installed packages from working directory                                                
   -AllowPreRelease (-pre)   Allows installation of packages' prelease versions                                              
   -Version (-V)             Outputs version information                                                                     
   -Watch (-W)               Watch the script file and reload it when changed                                                
   -Modules (-M)             Specify modules to load                                                                         
   -Config (-Co)             Defines config file name                                                                        
   -PackageVersion (-P)      Defines the version of the package to install. Used in conjunction with -install                
   -Output (-O)              Write all console output to the specified file                                                  

   EXAMPLE: scriptcs server.csx -logLevel debug
   Executes the 'server.csx' script and displays detailed log messages. Useful for debugging.



[Done] exited with code=1 in 0.302 seconds

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
formulahendrycommented, Jan 2, 2017

For quick workaround, you could try below settings in ‘User Settings’ of VS Code to avoid using full file path:

"code-runner.executorMap": 
{ 
"csharp": "cd $dir && scriptcs $fileName" 
}
0reactions
fifiteen82726commented, Mar 23, 2020

It seems scriptcs 0.17.1 has not yet fixed the problem lol.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble running C# code in VS Code: Getting scriptcs error
This is my first time using Visual Studio Code and I am trying to run a simple code on it but it is...
Read more >
Issues · scriptcs/scriptcs - GitHub
Write C# apps with a text editor, nuget and the power of Roslyn! - Issues · scriptcs/scriptcs.
Read more >
C# – Trouble running C# code in VS Code: Getting scriptcs error
This is my first time using Visual Studio Code and I am trying to run a simple code on it but it is...
Read more >
scriptcs
In scriptcs v0.14 we have introduced Script Libraries. ... NET solution, and cause errors or warnings when running scriptcs.
Read more >
Can't run C# VS Code Ubuntu : r/csharp - Reddit
Im getting this error when trying to run C# code on VS Code on Ubuntu 20.04: Command 'scriptcs' not found, did you mean:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found