http://scriptcs.net/
Unleash your C# from Visual Studio.
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. Information on installing Chocolatey is available at their website.
Installing scriptcs
Once Chocolatey has been installed, you can install the latest stable version of scriptcs from your command prompt:
cinst scriptcs
Chocolatey will install scriptcs to
%APPDATA%\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:
cup scriptcs
Nightly builds
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);
Writing a script
- In an empty directory, create a new file named
app.csx
: scriptcs app.cs