ScriptCS alternatives and similar packages
Based on the "Misc" category.
Alternatively, view ScriptCS alternatives based on common mentions on social networks and blogs.
-
Polly
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+. -
Humanizer
Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities -
Coravel
Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze! -
Hashids.net
A small .NET package to generate YouTube-like hashes from one or many numbers. Use hashids when you do not want to expose your database ids to the user. -
Scientist.NET
A .NET library for carefully refactoring critical paths. It's a port of GitHub's Ruby Scientist library -
WorkflowEngine
WorkflowEngine.NET - component that adds workflow in your application. It can be fully integrated into your application, or be in the form of a specific service (such as a web service). -
HidLibrary
This library enables you to enumerate and communicate with Hid compatible USB devices in .NET. -
DeviceId
A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer. -
Warden
Define "health checks" for your applications, resources and infrastructure. Keep your Warden on the watch. -
Aeron.NET
Efficient reliable UDP unicast, UDP multicast, and IPC message transport - .NET port of Aeron -
ByteSize
ByteSize is a utility class that makes byte size representation in code easier by removing ambiguity of the value being represented. ByteSize is to bytes what System.TimeSpan is to time. -
DeviceDetector.NET
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model. -
Mediator.Net
A simple mediator for .Net for sending command, publishing event and request response with pipelines supported -
https://github.com/minhhungit/ConsoleTableExt
A fluent library to print out a nicely formatted table in a console application C# -
SolidSoils4Arduino
C# .NET - Arduino library supporting simultaneous serial ASCII, Firmata and I2C communication -
FormHelper
ASP.NET Core - Transform server-side validations to client-side without writing any javascript code. (Compatible with Fluent Validation) -
Valit
Valit is dead simple validation for .NET Core. No more if-statements all around your code. Write nice and clean fluent validators instead! -
Validot
Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers. -
NaturalSort.Extension
🔀 Extension method for StringComparison that adds support for natural sorting (e.g. "abc1", "abc2", "abc10" instead of "abc1", "abc10", "abc2"). -
Outcome.NET
Never write a result wrapper again! Outcome.NET is a simple, powerful helper for methods that return a value, but sometimes also need to return validation messages, warnings, or a success bit. -
SystemTextJson.JsonDiffPatch
High-performance, low-allocating JSON object diff and patch extension for System.Text.Json. Support generating patch document in RFC 6902 JSON Patch format. -
dotnet-exec
Simplified C#, dotnet execute with custom entry point, another dotnet run without project file -
trybot
A transient fault handling framework including such resiliency solutions as Retry, Timeout, Fallback, Rate Limit and Circuit Breaker.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of ScriptCS or a related project?
README
scriptcs
What is it?
scriptcs makes it easy to write and execute C# with a simple text editor.
While Visual Studio, and other IDEs, are powerful tools, they can sometimes hinder productivity more than they promote it. You don’t always need, or want, the overhead of a creating a new solution or project. Sometimes you want to just type away in your favorite text editor.
scriptcs frees you from Visual Studio, without sacrificing the advantages of a strongly-typed language.
- Write C# in your favorite text editor.
- Use NuGet to manage your dependencies.
- The relaxed C# scripting syntax means you can write and execute an application with only one line of code.
- Script Packs allow you to bootstrap the environment for new scripts, further reduces the amount of code necessary to take advantage of your favorite C# frameworks.
Getting scriptcs
Releases and nightly builds should be installed using Chocolatey. To install Chocolatey, execute the following command in your command prompt:
@powershell -NoProfile -ExecutionPolicy Unrestricted -Command "iex ((New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
If the above fails with the error indicating that proxy authentication is required (i.e. HTTP 407) then try again with the following on the command prompt that uses your default credentials:
@powershell -NoProfile -ExecutionPolicy Unrestricted -Command "[Net.WebRequest]::DefaultWebProxy.Credentials = [Net.CredentialCache]::DefaultCredentials; iex ((New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
Note: If you are using a version of Chocolatey > 0.9.9.0 you can pass the -y
into the install and upgrade commands to prevent the confirmation that will appear.
Installing scriptcs
Once Chocolatey has been installed, you can install the latest stable version of scriptcs from your command prompt:
choco install scriptcs
Chocolatey will install scriptcs to %LOCALAPPDATA%\scriptcs\
and update your PATH accordingly.
Note: You may need to restart your command prompt after the installation completes.
Staying up-to-date
With Chocolatey, keeping scriptcs updated is just as easy:
choco upgrade scriptcs
Note: If you are using a version of Chocolatey < 0.9.0.0 you will need to use choco update scriptcs
, but also think about updating Chocolatey itself.
Nightly builds
Nightly builds are hosted on MyGet, and can also be installed through with Chocolatey:
choco install scriptcs -pre -source https://www.myget.org/F/scriptcsnightly/
Building from source
Windows
Ensure you have .NET Framework 4.5 installed.
Execute the build script.
build.cmd
Linux
Ensure you have Mono development tools 3.0 or later installed.
sudo apt-get install mono-devel
Ensure your mono instance has root SSL certificates
mozroots --import --sync
Execute the build script
./build.sh
Getting Started
Using the REPL
The scriptcs REPL can be started by running scriptcs without any parameters. The REPL allows you to execute C# statements directly from your command prompt.
C:\> scriptcs
scriptcs (ctrl-c or blank to exit)
> var message = "Hello, world!";
> Console.WriteLine(message);
Hello, world!
>
C:\>
REPL supports all C# language constructs (i.e. class definition, method definition), as well as multi-line input. For example:
C:\> scriptcs
scriptcs (ctrl-c or blank to exit)
> public class Test {
public string Name { get; set; }
}
> var x = new Test { Name = "Hello" };
> x
{Name: "Hello"}
C:\>
Writing a script
- In an empty directory, create a new file named
app.csx
:
using Raven.Client;
using Raven.Client.Embedded;
using Raven.Client.Indexes;
Console.WriteLine("Starting RavenDB server...");
EmbeddableDocumentStore documentStore = null;
try
{
documentStore = new EmbeddableDocumentStore { UseEmbeddedHttpServer = true };
documentStore.Initialize();
var url = string.Format("http://localhost:{0}", documentStore.Configuration.Port);
Console.WriteLine("RavenDB started, listening on {0}.", url);
Console.ReadKey();
}
finally
{
if (documentStore != null)
documentStore.Dispose();
}
- Install the RavenDB.Embedded package from NuGet using the install command.
scriptcs -install RavenDB.Embedded
- Execute your script. Note that listening on a port requires that the command prompt be launched using the Run as Administrator option.
> scriptcs app.csx
INFO : Starting to create execution components
INFO : Starting execution
Starting RavenDB server...
.. snip ..
RavenDB started, listening on http://localhost:8080.
- Navigating to the URL that Raven is listening on will now bring up the RavenDB management studio.
Bootstrap scripts with Script Packs
Script Packs can be used to further reduce the amount of code you need to write when working with common frameworks.
- In an empty directory, install the ScriptCs.WebApi script pack from NuGet. The script pack automatically imports the Web API namespaces and provides a convenient factory method for initializing the Web API host. It also replaces the default
ControllerResolver
with a custom implementation that allows Web API to discover controllers declared in scripts.
scriptcs -install ScriptCs.WebApi
- Script packs can be imported into a script by calling
Require<TScriptPack>()
. Create a file namedserver.csx
that contains the following code:
public class TestController : ApiController {
public string Get() {
return "Hello world!";
}
}
var webApi = Require<WebApi>();
var server = webApi.CreateServer("http://localhost:8888");
server.OpenAsync().Wait();
Console.WriteLine("Listening...");
Console.ReadKey();
server.CloseAsync().Wait();
- In a command prompt running as administrator, execute the
server.csx
file.
scriptcs server.csx
- Browse to http://localhost:8888/test/ to see the result of the TestController.Get method.
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Hello world!</string>
Referencing scripts
Move the TestController class from the previous example into a new file named
controller.csx
with the following content.On the first line of
server.csx
, referencecontroller.csx
using the #load directive. Note: #load directives must be placed at the top of a script, otherwise they will be ignored.
#load "controller.csx"
- In a command prompt running as administrator, execute the
server.csx
file.
scriptcs server.csx
- Browse to http://localhost:8888/test/ to see the result of the TestController.Get method.
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Hello world!</string>
Referencing assemblies
You can reference additional assemblies from the GAC or from the bin
folder in your script's directory using the #r directive:
#r "nunit.core.dll"
#r "nunit.core.interfaces.dll"
var path = "UnitTests.dll";
var runner = TestSetup.GetRunner(new[] {path});
var result = runner.Run(new ConsoleListener(msg => Console.WriteLine(msg)), TestFilter.Empty, true, LoggingThreshold.All);
Console.ReadKey();
Debugging
Instructions for debugging scripts using Visual Studio can be found on the wiki.
Package installation
You can install any NuGet packages directly from the scriptcs CLI. This will pull the relevant packages from NuGet, and install them in the scriptcs_packages folder.
Once the packages are installed, you can simply start using them in your script code directly (just import the namespaces - no additional bootstrapping or DLL referencing is needed).
The install
command will also create a scriptcs_packages.config
file if you don't have one - so that you can easily redistribute your script (without having to copy the package binaries).
scriptcs -install {package name}
will install the desired package from NuGet.For example:
scriptcs -install ServiceStack
scriptcs -install
(without package name) will look for thescriptcs_packages.config
file located in the current execution directory, and install all the packages specified there. You only need to specify top level packages.
For example, you might create the following scriptcs_packages.config
:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Nancy.Hosting.Self" version="0.16.1" targetFramework="net40" />
<package id="Nancy.Bootstrappers.Autofac" version="0.16.1" targetFramework="net40" />
<package id="Autofac" version="2.6.3.862" targetFramework="net40" />
</packages>
And then just call:
scriptcs -install
As a result, all packages specified in the scriptcs_packages.config
, including all dependencies, will be downloaded and installed in the scriptcs_packages
folder.
Contributing
- Read our Contribution Guidelines.
Samples and Documentation
Additional samples can be contributed to our samples repository. Documentation can be found on our wiki.
Community
Want to chat? In addition to Twitter, you can find us on Google Groups and JabbR!
Coordinators
Core Committers
- Damian Schenkelman (@dschenkelman)
- Kristian Hellang (@khellang)
- Adam Ralph (@adamralph)
- Paul Bouwer (@pbouwer)
Credits
- Check out the list of developers responsible for getting scriptcs to where it is today!
- Special thanks to Filip Wojcieszyn for being the inspiration behind this with his Roslyn Web API posts.
- Thanks to the Roslyn team who helped point me in the right direction.
License
*Note that all licence references and agreements mentioned in the ScriptCS README section above
are relevant to that project's source code only.