scriptcs makes it easy to write and execute C#, either by using the REPL or your simple text editor. It integrates with NuGet to easily pull down packages for use in your scripts.
Questions tagged [scriptcs]
56 questions
25
votes
1 answer
scriptcs hosting - Advantages over Roslyn
If I want to support scripting in my application, does scriptcs offer any particular advantages over just using the plain vanilla Roslyn script engine?

Damian
- 2,709
- 2
- 29
- 40
20
votes
7 answers
Why doesn't Console.WriteLine work in Visual Studio Code?
I have scriptcs and coderunner installed on Visual Studio Code. When I run a simple program that includes Console.WriteLine("Test") I don't see any output. The program seems to run successfully and exits with code 0.
Any suggestions?
Here's all…

Matt West
- 1,376
- 1
- 12
- 18
20
votes
3 answers
How to define an extension method in a scriptcs csx script
I'm playing with ScriptCS (which is awesome!) but I couldn't figure out how to define an extension method within a .csx script file.
Take this example:
using System.IO;
public static class Extensions
{
public static string Remove(this string…

TJB
- 13,367
- 4
- 34
- 46
15
votes
10 answers
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 giving me an error that says:
'scriptcs' is not recognized as an internal or external command,
operable program or batch file.
I have this as…

Rohan Rao
- 2,505
- 3
- 19
- 39
14
votes
1 answer
Getting error: /bin/sh scriptcs: command not found
I'm using Visual Studio Code for Mac, running extension CodeRunner.
I've got a simple program:
using System;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
Console.WriteLine("hellowol");
}
…

jamesfdearborn
- 769
- 1
- 10
- 26
13
votes
3 answers
Assembly changes detected. Restarting host
My Azure Functions were running fine and all of a sudden I am getting several "Assembly changes detected. Restarting host..." messages that is preventing my functions from completing.
I am not deploying new code so not sure what is triggering the…

Andy T
- 10,223
- 5
- 53
- 95
11
votes
4 answers
Launch a .csx (scriptcs) C# script directly without opening a command line window
Is there a way in Windows to launch a .csx script directly (e.g. by double clicking the file, or from the start menu, or via an app launcher like Launchy) such that the script runs in the background without opening a command line window?
For…

ivanatpr
- 1,862
- 14
- 18
7
votes
4 answers
Execute ScriptCS from c# application
Background
I'm creating a c# application that runs some status checks (think nagios style checks).
What I ideally want is this c# application to look at a specific directory, and just compile/execute any scriptcs scripts within it, and act on the…

Kyle Gobel
- 5,530
- 9
- 45
- 68
6
votes
2 answers
Error on running Scriptcs with Sublime Text 3
I have installed Scriptcs to Sublime Text 3.
I get this error when I press CTRL B and build my aspx page.
'scriptcs' is not recognized as an internal or external command,
operable program or batch file.
I'm trying to run my aspx page on…

Bengi Besçeli
- 3,638
- 12
- 53
- 87
6
votes
1 answer
for scriptcs `dynamic` is not supported by Roslyn and available only with mono, but mono fails on DLL
I'm try to load pythonnet runtime dll from scriptcs and it does not work with roslyn backend because dynamic is not supported in Roslyn, but mono backend chokes with the following error:
$ scriptcs -modules mono
scriptcs (ctrl-c to exit or :help for…

denfromufa
- 5,610
- 13
- 81
- 138
4
votes
2 answers
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) {
…

jamesfdearborn
- 769
- 1
- 10
- 26
4
votes
1 answer
Using HttpClient from scriptcs script
I am trying to use HttpClient from a scriptcs script but experiencing some issues. First, I wasn't able to even install a Microsoft.Net.Http NuGet package because this package requires NuGet 2.8, and scriptcs was installed with NuGet.Core.dll…

Vagif Abilov
- 9,835
- 8
- 55
- 100
3
votes
1 answer
Can I run scriptcs with useLegacyV2RuntimeActivationPolicy?
I have a DLL (Microsoft.SqlServer.BatchParser) which I need to reference in a scriptcs file.
The following DLL can only be referenced if useLegacyV2RuntimeActivationPolicy is included in the app.config file.
For example, this console…

Yaron Levi
- 12,535
- 16
- 69
- 118
3
votes
0 answers
How can the new C# 6.0 syntax features be used in scriptCS?
If I try to compile the following code with scriptCS it fails compilation with a syntax error for the line containing the primary constructor (Error CS 1514 '{' expected to be exact):
public class MyClass(string someName)
{
public string Name {…

andyp
- 6,229
- 3
- 38
- 55
3
votes
1 answer
How do I reference custom assemblies with scriptcs?
I have some custom DLLs that I want to reference in a script (stored on my HDD). I can see how I reference Nuget packages but I don't think it applies here.
How can I reference these assemblies?

Mike
- 1,233
- 1
- 10
- 14