Skip to content

Releases: oleg-shilo/cs-script

Release v4.14.3

10 Mar 08:11

Choose a tag to compare

Note

Windows Defender often marks zip files as infected for no reason. Use VirisTotal reports to ensure the safety of any downloaded distributable:

Installing

  • CLI tool:
    dotnet tool install --global cs-script.cli
  • Hosted class library in .NET Project: create the project from any .NET project template and add CS-Script nuget package:
    dotnet add package cs-script.
More Deployment Options (detailed installation Instructions)

Deployment

Any OS

Install as .NET Tool

dotnet tool install --global cs-script.cli

After that, you can invoke the script engine as css.
You may need to add the folder of css to the system PATH, unless .NET SDK setup does it.
It can be one of these, depending on your OS:

  • %USERPROFILE%\. dotnet\tools
  • ~/.dotnet/tools
  • $HOME/.dotnet/tools

Note:

  • Before upgrading the already installed tool, you may need to ensure the script engine is not running. You can do it with a simple command css -kill.
  • You may prefer to enable an optional build server (see css -server ?) to boost script compilation performance. On Windows, it's done automatically on the very first execution, but on Linux, if you want to use this feature, it needs to be done manually (sudo css -server:add).

Linux

Ubuntu (terminal)

repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.14.3.0/; file=cs-script_4.14-3.deb; rm $file; wget $repo$file; sudo dpkg -i $file

Depending on the user context, you may need to add permissions to the CS-Script temp dir sudo chmod -R 777 /tmp

You can also create a convenient alias (cs-script_x.x-x.deb package does it automatically):

alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+

After that, you can invoke CS-Script engine from anywhere by just typing 'css'.

Note: this very release is not available on Chocolatey and WinGet but only on Nuget (.NET tool) as described above.

Windows

Chocolatey

choco install cs-script

WinGet (pending approval)

winget install cs-script

Scoop

scoop bucket add cs-script https://github.com/oleg-shilo/cs-script
scoop install cs-script

Manual (Any OS)

Just unpack the corresponding 7z file and start using the script engine executable cscs.

When using on Windows, you can build an alias(shim) exe css.exe for an easy launch of the script engine process: cscs -self-alias.
The same shim is created if you are installing the CS-Script as a choco package.

Barebone distribution

The minimalistic manual distro on the target machine with .NET SDK installed is just a set of the script engine files:

Linux

cscs.dll
cscs.runtimeconfig.json

Running: dotnet ./cscs.dll <script>

You can also create an alias for convenient access:

echo "alias css='dotnet /usr/local/bin/cs-script/cscs.dll'" >> ~/.bashrc
source ~/.bashrc

And then you can run scripts with a simple: css <script>

Windows

cscs.exe
cscs.dll
cscs.runtimeconfig.json

Running: cscs.exe <script>


Changes

Misc

  • Support multiple //css_precompiler directives in a single line
  • Marked CompilerLastOutput as obsolete with error enforcement.

CLI

  • #452: Execution with -ng:csc on Linux fails
  • Implemented support for top-level statements when using Roslyn compiler engine

CSScriptLib

  • #455: Add //css_precompiler support for RoslynEvaluator and CodDomEvaluator

Release v4.14.2

04 Mar 08:28

Choose a tag to compare

Note

Windows Defender often marks zip files as infected for no reason. Use VirisTotal reports to ensure the safety of any downloaded distributable:

Installing

  • CLI tool:
    dotnet tool install --global cs-script.cli
  • Hosted class library in .NET Project: create the project from any .NET project template and add CS-Script nuget package:
    dotnet add package cs-script.
More Deployment Options (detailed installation Instructions)

Deployment

Any OS

Install as .NET Tool

dotnet tool install --global cs-script.cli

After that, you can invoke the script engine as css.
You may need to add the folder of css to the system PATH, unless .NET SDK setup does it.
It can be one of these, depending on your OS:

  • %USERPROFILE%\. dotnet\tools
  • ~/.dotnet/tools
  • $HOME/.dotnet/tools

Note:

  • Before upgrading the already installed tool, you may need to ensure the script engine is not running. You can do it with a simple command css -kill.
  • You may prefer to enable an optional build server (see css -server ?) to boost script compilation performance. On Windows, it's done automatically on the very first execution, but on Linux, if you want to use this feature, it needs to be done manually (sudo css -server:add).

Linux

Ubuntu (terminal)

repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.14.0.0/; file=cs-script_4.14-0.deb; rm $file; wget $repo$file; sudo dpkg -i $file

Depending on the user context, you may need to add permissions to the CS-Script temp dir sudo chmod -R 777 /tmp

You can also create a convenient alias (cs-script_x.x-x.deb package does it automatically):

alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+

After that, you can invoke CS-Script engine from anywhere by just typing 'css'.

Note: this very release is not available on Chocolatey and WinGet but only on Nuget (.NET tool) as described above.

Windows

Chocolatey

choco install cs-script

WinGet (pending approval)

winget install cs-script

Scoop

scoop bucket add cs-script https://github.com/oleg-shilo/cs-script
scoop install cs-script

Manual (Any OS)

Just unpack the corresponding 7z file and start using the script engine executable cscs.

When using on Windows, you can build an alias(shim) exe css.exe for an easy launch of the script engine process: cscs -self-alias.
The same shim is created if you are installing the CS-Script as a choco package.

Barebone distribution

The minimalistic manual distro on the target machine with .NET SDK installed is just a set of the script engine files:

Linux

cscs.dll
cscs.runtimeconfig.json

Running: dotnet ./cscs.dll <script>

You can also create an alias for convenient access:

echo "alias css='dotnet /usr/local/bin/cs-script/cscs.dll'" >> ~/.bashrc
source ~/.bashrc

And then you can run scripts with a simple: css <script>

Windows

cscs.exe
cscs.dll
cscs.runtimeconfig.json

Running: cscs.exe <script>


Changes

The major changes in this release are around improved support for working with external compile engines in CodeDom evaluator mode. Now, CLI and CSScriptLib APIs allow automatic download and deployment of the latest .NET compilers (nuget packages) on the target system, so the user does not have to install the complete .NET SDK.

Caching and temp files management have also been improved dramatically and made more consistent and reliable.

Another significant change is heavy refactoring and documentation improvements.

Special thank you to @maettu-this, who helped with the requirements for all these changes.

========================================

Misc

  • #444: "The documentation texts of CompileAssemblyFrom..."
  • Updated CodeDom-Evaluator-Dependencies.md to reference the new deployment option.
  • Reworked and unified csc.exe probing for CodeDom compilation.
  • Intensive code housekeeping
  • Major rework of the .NET Framework samples. Triggered by #442

CLI

  • Improved cache cleanup mechanism to prevent endless growth of csscript.core directory
  • Enabled Runtime.CleanAbandonedCache() to automatically remove cache directories when source scripts are deleted
  • -pkill command improvements. Bump version to 1.0.1
  • Added -deploy-csc switch for compiler deployment via NuGet
  • Enhanced the LockCheck sample to better handle directory lock checks using handle.exe as a fallback.

CSScriptLib

  • #434: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies
  • #435: /share compiler flag causes CS2007 error after upgrading to 4.13.1
  • #436: SerializationException: Type 'CSScripting.CodeDom.CompilerError' in assembly 'CSScriptLib...
  • #437: updated wrong resource referencing.
  • #441: Change CodeDomEvaluator.IsCachingEnabled default to true
  • #445: Missing information on resulting compilation details?
  • #448: Using preprocessor directives with Roslyn / SourceCodeKind.Regular
  • #449: RoslynEvaluator ignores disabling referencing AppDomain assemblies.
  • #447: Proposing EvaluatorBase.CompileFile for consistency with EvaluatorBase.CompileAssemblyFromFile
    Add AttachedProperties and project context to compilation
  • Enabled abandoned cache cleanup to prevent endless growth of csscript.lib directory
  • Cache directories are now automatically cleaned when source script directories no longer exist
  • Added NugetPackageDownloader and unified compiler discovery
  • Deprecated CompilerLastOutput; add CompilerInput/Output
  • Added DownloadLatestSdkToolset to NugetPackageDownloader for automated retrieval of compilers and reference assemblies. It improves support for environments without .NET SDK.

Temporary Directory Structure

CS-Script now uses separate temporary directories for better isolation:

%TEMP% (or $TMPDIR on Linux)
├── csscript.core\ # CLI execution (cscs.exe, csws.exe)
│ ├── cache\ # Compiled script cache
│ ├── snippets\ # -code execution cache
│ └── DbgAttach\ # Debug metadata
└── csscript.lib\ # Library/hosted evaluation (CSScriptLib)
├── cache\ # Compiled script cache
└── tmp files # Temporary compilation artifacts

Release v4.14.0

03 Mar 11:11

Choose a tag to compare

Note

Windows Defender often marks zip files as infected for no reason. Use VirisTotal reports to ensure the safety of any downloaded distributable:

Installing

  • CLI tool:
    dotnet tool install --global cs-script.cli
  • Hosted class library in .NET Project: create the project from any .NET project template and add CS-Script nuget package:
    dotnet add package cs-script.
More Deployment Options (detailed installation Instructions)

Deployment

Any OS

Install as .NET Tool

dotnet tool install --global cs-script.cli

After that, you can invoke the script engine as css.
You may need to add the folder of css to the system PATH, unless .NET SDK setup does it.
It can be one of these, depending on your OS:

  • %USERPROFILE%\. dotnet\tools
  • ~/.dotnet/tools
  • $HOME/.dotnet/tools

Note:

  • Before upgrading the already installed tool, you may need to ensure the script engine is not running. You can do it with a simple command css -kill.
  • You may prefer to enable an optional build server (see css -server ?) to boost script compilation performance. On Windows, it's done automatically on the very first execution, but on Linux, if you want to use this feature, it needs to be done manually (sudo css -server:add).

Linux

Ubuntu (terminal)

repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.14.0.0/; file=cs-script_4.14-0.deb; rm $file; wget $repo$file; sudo dpkg -i $file

Depending on the user context, you may need to add permissions to the CS-Script temp dir sudo chmod -R 777 /tmp

You can also create a convenient alias (cs-script_x.x-x.deb package does it automatically):

alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+

After that, you can invoke CS-Script engine from anywhere by just typing 'css'.

Note: this very release is not available on Chocolatey and WinGet but only on Nuget (.NET tool) as described above.

Windows

Chocolatey

choco install cs-script

WinGet (pending approval)

winget install cs-script

Scoop

scoop bucket add cs-script https://github.com/oleg-shilo/cs-script
scoop install cs-script

Manual (Any OS)

Just unpack the corresponding 7z file and start using the script engine executable cscs.

When using on Windows, you can build an alias(shim) exe css.exe for an easy launch of the script engine process: cscs -self-alias.
The same shim is created if you are installing the CS-Script as a choco package.

Barebone distribution

The minimalistic manual distro on the target machine with .NET SDK installed is just a set of the script engine files:

Linux

cscs.dll
cscs.runtimeconfig.json

Running: dotnet ./cscs.dll <script>

You can also create an alias for convenient access:

echo "alias css='dotnet /usr/local/bin/cs-script/cscs.dll'" >> ~/.bashrc
source ~/.bashrc

And then you can run scripts with a simple: css <script>

Windows

cscs.exe
cscs.dll
cscs.runtimeconfig.json

Running: cscs.exe <script>


Changes

The major changes in this release are around improved support for working with external compile engines in CodeDom evaluator mode. Now, CLI and CSScriptLib APIs allow automatic download and deployment of the latest .NET compilers (nuget packages) on the target system, so the user does not have to install the complete .NET SDK.

Caching and temp files management have also been improved dramatically and made more consistent and reliable.

Another significant change is heavy refactoring and documentation improvements.

Special thank you to @maettu-this, who helped with the requirements for all these changes.

========================================

Misc

  • #444: "The documentation texts of CompileAssemblyFrom..."
  • Updated CodeDom-Evaluator-Dependencies.md to reference the new deployment option.
  • Reworked and unified csc.exe probing for CodeDom compilation.
  • Intensive code housekeeping
  • Major rework of the .NET Framework samples. Triggered by #442

CLI

  • Improved cache cleanup mechanism to prevent endless growth of csscript.core directory
  • Enabled Runtime.CleanAbandonedCache() to automatically remove cache directories when source scripts are deleted
  • -pkill command improvements. Bump version to 1.0.1
  • Added -deploy-csc switch for compiler deployment via NuGet
  • Enhanced the LockCheck sample to better handle directory lock checks using handle.exe as a fallback.

CSScriptLib

  • #434: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies
  • #435: /share compiler flag causes CS2007 error after upgrading to 4.13.1
  • #436: SerializationException: Type 'CSScripting.CodeDom.CompilerError' in assembly 'CSScriptLib...
  • #437: updated wrong resource referencing.
  • #441: Change CodeDomEvaluator.IsCachingEnabled default to true
  • #445: Missing information on resulting compilation details?
  • #448: Using preprocessor directives with Roslyn / SourceCodeKind.Regular
  • #449: RoslynEvaluator ignores disabling referencing AppDomain assemblies.
  • #447: Proposing EvaluatorBase.CompileFile for consistency with EvaluatorBase.CompileAssemblyFromFile
    Add AttachedProperties and project context to compilation
  • Enabled abandoned cache cleanup to prevent endless growth of csscript.lib directory
  • Cache directories are now automatically cleaned when source script directories no longer exist
  • Added NugetPackageDownloader and unified compiler discovery
  • Deprecated CompilerLastOutput; add CompilerInput/Output
  • Added DownloadLatestSdkToolset to NugetPackageDownloader for automated retrieval of compilers and reference assemblies. It improves support for environments without .NET SDK.

Temporary Directory Structure

CS-Script now uses separate temporary directories for better isolation:

%TEMP% (or $TMPDIR on Linux)
├── csscript.core\ # CLI execution (cscs.exe, csws.exe)
│ ├── cache\ # Compiled script cache
│ ├── snippets\ # -code execution cache
│ └── DbgAttach\ # Debug metadata
└── csscript.lib\ # Library/hosted evaluation (CSScriptLib)
├── cache\ # Compiled script cache
└── tmp files # Temporary compilation artifacts

Release v4.13.2.0

24 Jan 03:38

Choose a tag to compare

This version is not published on Chocolatey, WinGet, or NuGet Tools since no changes to the CLI implementation.
Thus, this version is only published as a NuGet package.


Changes

CLI

  • no changes

CSScriptLib

  • #436: SerializationException: Type 'CSScripting.CodeDom.CompilerError' in assembly 'CSScriptLib...
  • #437: updated wrong resource referencing.
  • #435: /share compiler flag causes CS2007 error after upgrading to 4.13.1

Release v4.13.1.0

20 Dec 10:27

Choose a tag to compare

Note

Windows Defender often marks zip files as infected for no reason. Use VirisTotal reports to ensure the safety of any downloaded distributable:

Installing

  • CLI tool:
    dotnet tool install --global cs-script.cli
  • Hosted class library in .NET Project: create the project from any .NET project template and add CS-Script nuget package:
    dotnet add package cs-script.
More Deployment Options (detailed installation Instructions)

Deployment

Any OS

Install as .NET Tool

dotnet tool install --global cs-script.cli

After that, you can invoke the script engine as css.
You may need to add the folder of css to the system PATH, unless .NET SDK setup does it.
It can be one of these, depending on your OS:

  • %USERPROFILE%\. dotnet\tools
  • ~/.dotnet/tools
  • $HOME/.dotnet/tools

Note:

  • Before upgrading the already installed tool, you may need to ensure the script engine is not running. You can do it with a simple command css -kill.
  • You may prefer to enable an optional build server (see css -server ?) to boost script compilation performance. On Windows, it's done automatically on the very first execution, but on Linux, if you want to use this feature, it needs to be done manually (sudo css -server:add).

Linux

Ubuntu (terminal)

repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.12.0.0/; file=cs-script_4.12-0.deb; rm $file; wget $repo$file; sudo dpkg -i $file

Depending on the user context, you may need to add permissions to the CS-Script temp dir sudo chmod -R 777 /tmp

You can also create a convenient alias (cs-script_x.x-x.deb package does it automatically):

alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+

After that, you can invoke CS-Script engine from anywhere by just typing 'css'.

Note: this very release is not available on Chocolatey and WinGet but only on Nuget (.NET tool) as described above.

Windows

Chocolatey

choco install cs-script

WinGet (pending approval)

winget install cs-script

Scoop

scoop bucket add cs-script https://github.com/oleg-shilo/cs-script
scoop install cs-script

Manual (Any OS)

Just unpack the corresponding 7z file and start using the script engine executable cscs.

When using on Windows, you can build an alias(shim) exe css.exe for an easy launch of the script engine process: cscs -self-alias.
The same shim is created if you are installing the CS-Script as a choco package.

Barebone distribution

The minimalistic manual distro on the target machine with .NET SDK installed is just a set of the script engine files:

Linux

cscs.dll
cscs.runtimeconfig.json

Running: dotnet ./cscs.dll <script>

You can also create an alias for convenient access:

echo "alias css='dotnet /usr/local/bin/cs-script/cscs.dll'" >> ~/.bashrc
source ~/.bashrc

And then you can run scripts with a simple: css <script>

Windows

cscs.exe
cscs.dll
cscs.runtimeconfig.json

Running: cscs.exe <script>


Changes

CLI

  • #432: "Restoring packages..." hangs
  • Added compiler NET10_0_OR_GREATER and NET10 for .NET10 scripts.
  • Added public ConsoleExtensions
    Console.Print("Running on .NET 10 or greater", DarkGreen);
    Console.Print("Hello");
    var name = Console.Prompt("Enter your name: ", DarkYellow);

CSScriptLib

  • no changes

Release v4.13.0.0

11 Dec 13:56

Choose a tag to compare

Note

Windows Defender often marks zip files as infected for no reason. Use VirisTotal reports to ensure the safety of any downloaded distributable:

Installing

  • CLI tool:
    dotnet tool install --global cs-script.cli
  • Hosted class library in .NET Project: create the project from any .NET project template and add CS-Script nuget package:
    dotnet add package cs-script.
More Deployment Options (detailed installation Instructions)

Deployment

Any OS

Install as .NET Tool

dotnet tool install --global cs-script.cli

After that, you can invoke the script engine as css.
You may need to add the folder of css to the system PATH, unless .NET SDK setup does it.
It can be one of these, depending on your OS:

  • %USERPROFILE%\. dotnet\tools
  • ~/.dotnet/tools
  • $HOME/.dotnet/tools

Note:

  • Before upgrading the already installed tool, you may need to ensure the script engine is not running. You can do it with a simple command css -kill.
  • You may prefer to enable an optional build server (see css -server ?) to boost script compilation performance. On Windows, it's done automatically on the very first execution, but on Linux, if you want to use this feature, it needs to be done manually (sudo css -server:add).

Linux

Ubuntu (terminal)

repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.12.0.0/; file=cs-script_4.12-0.deb; rm $file; wget $repo$file; sudo dpkg -i $file

Depending on the user context, you may need to add permissions to the CS-Script temp dir sudo chmod -R 777 /tmp

You can also create a convenient alias (cs-script_x.x-x.deb package does it automatically):

alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+

After that, you can invoke CS-Script engine from anywhere by just typing 'css'.

Note: this very release is not available on Chocolatey and WinGet but only on Nuget (.NET tool) as described above.

Windows

Chocolatey

choco install cs-script

WinGet (pending approval)

winget install cs-script

Scoop

scoop bucket add cs-script https://github.com/oleg-shilo/cs-script
scoop install cs-script

Manual (Any OS)

Just unpack the corresponding 7z file and start using the script engine executable cscs.

When using on Windows, you can build an alias(shim) exe css.exe for an easy launch of the script engine process: cscs -self-alias.
The same shim is created if you are installing the CS-Script as a choco package.

Barebone distribution

The minimalistic manual distro on the target machine with .NET SDK installed is just a set of the script engine files:

Linux

cscs.dll
cscs.runtimeconfig.json

Running: dotnet ./cscs.dll <script>

You can also create an alias for convenient access:

echo "alias css='dotnet /usr/local/bin/cs-script/cscs.dll'" >> ~/.bashrc
source ~/.bashrc

And then you can run scripts with a simple: css <script>

Windows

cscs.exe
cscs.dll
cscs.runtimeconfig.json

Running: cscs.exe <script>


Changes

CLI

  • #430: //css_reference search order
  • Various improvements around css -help output
  • Fixed css -kill command

CSScriptLib

  • multiple API points made public to address "#431 Generic type for CompileMethod()" challenges

Release v4.12.0.0

15 Nov 09:20

Choose a tag to compare

Note

Windows Defender often marks zip files as infected for no reason. Use VirisTotal reports to ensure the safety of any downloaded distributable:

Installing

  • CLI tool:
    dotnet tool install --global cs-script.cli
  • Hosted class library in .NET Project: create the project from any .NET project template and add CS-Script nuget package:
    dotnet add package cs-script.
More Deployment Options (detailed installation Instructions)

Deployment

Any OS

Install as .NET Tool

dotnet tool install --global cs-script.cli

After that, you can invoke the script engine as css.
You may need to add the folder of css to the system PATH, unless .NET SDK setup does it.
It can be one of these, depending on your OS:

  • %USERPROFILE%\. dotnet\tools
  • ~/.dotnet/tools
  • $HOME/.dotnet/tools

Note:

  • Before upgrading the already installed tool, you may need to ensure the script engine is not running. You can do it with a simple command css -kill.
  • You may prefer to enable an optional build server (see css -server ?) to boost script compilation performance. On Windows, it's done automatically on the very first execution, but on Linux, if you want to use this feature, it needs to be done manually (sudo css -server:add).

Linux

Ubuntu (terminal)

repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.13.0.0/; file=cs-script_4.13-0.deb; rm $file; wget $repo$file; sudo dpkg -i $file

Depending on the user context, you may need to add permissions to the CS-Script temp dir sudo chmod -R 777 /tmp

You can also create a convenient alias (cs-script_x.x-x.deb package does it automatically):

alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+

After that, you can invoke CS-Script engine from anywhere by just typing 'css'.

Note: this very release is not available on Chocolatey and WinGet but only on Nuget (.NET tool) as described above.

Windows

Chocolatey

choco install cs-script

WinGet (pending approval)

winget install cs-script

Scoop

scoop bucket add cs-script https://github.com/oleg-shilo/cs-script
scoop install cs-script

Manual (Any OS)

Just unpack the corresponding 7z file and start using the script engine executable cscs.

When using on Windows, you can build an alias(shim) exe css.exe for an easy launch of the script engine process: cscs -self-alias.
The same shim is created if you are installing the CS-Script as a choco package.

Barebone distribution

The minimalistic manual distro on the target machine with .NET SDK installed is just a set of the script engine files:

Linux

cscs.dll
cscs.runtimeconfig.json

Running: dotnet ./cscs.dll <script>

You can also create an alias for convenient access:

echo "alias css='dotnet /usr/local/bin/cs-script/cscs.dll'" >> ~/.bashrc
source ~/.bashrc

And then you can run scripts with a simple: css <script>

Windows

cscs.exe
cscs.dll
cscs.runtimeconfig.json

Running: cscs.exe <script>


Changes

  • CS-Script build for .NET 9 is no longer available. The supported version ar now the last two .NET LTS releases: .NET 8 and .NET 10.

CLI

  • CS-Script ported to .NET 10
  • Added '-l' option for auto-selecting the latest available .NET Runtime with the call: css -self-rt -l
  • Added support for .NET 10 file-based execution directives: #:package and #r.
  • Changed the search dir priorities to low local overwrite of the distributed included scrips (libs): %CSSCRIPT_INC% is now higher than "%CSSCRIPT_ROOT%/lib`
  • In the css.exe status print out is now saying <not set> instead of <not integrated> for the InstallationDir field.
    It's not really about the integration but setting the CSSCRIPT_ROOT envar.
  • Updated ProjectBuilder.GenerateProjectFor to include the script engine assembly and global includes (e.g. global-usings)

CSScriptLib

  • #428: Script.Evaluator.Eval() exception
  • Added /shared option for CodeDomEvaluator. To dramatically speedup "next" compilation.

Release v4.11.5.0

28 Oct 01:22

Choose a tag to compare

Note

Windows Defender often marks zip files as infected for no reason. Use VirisTotal reports to ensure the safety of any downloaded distributable:

Installing

  • CLI tool:
    dotnet tool install --global cs-script.cli
  • Hosted class library in .NET Project: create the project from any .NET project template and add CS-Script nuget package:
    dotnet add package cs-script.
More Deployment Options (detailed installation Instructions)

Deployment

Any OS

Install as .NET Tool

dotnet tool install --global cs-script.cli

After that, you can invoke the script engine as css.
You may need to add the folder of css to the system PATH, unless .NET SDK setup does it.
It can be one of these, depending on your OS:

  • %USERPROFILE%\. dotnet\tools
  • ~/.dotnet/tools
  • $HOME/.dotnet/tools

Note:

  • Before upgrading the already installed tool, you may need to ensure the script engine is not running. You can do it with a simple command css -kill.
  • You may prefer to enable an optional build server (see css -server ?) to boost script compilation performance. On Windows, it's done automatically on the very first execution, but on Linux, if you want to use this feature, it needs to be done manually (sudo css -server:add).

Linux

Ubuntu (terminal)

repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.11.5.0/; file=cs-script_4.11-5.deb; rm $file; wget $repo$file; sudo dpkg -i $file

Depending on the user context, you may need to add permissions to the CS-Script temp dir sudo chmod -R 777 /tmp

You can also create a convenient alias (cs-script_x.x-x.deb package does it automatically):

alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+

After that, you can invoke CS-Script engine from anywhere by just typing 'css'.

Note: this very release is not available on Chocolatey and WinGet but only on Nuget (.NET tool) as described above.

Windows

Chocolatey

choco install cs-script

WinGet (pending approval)

winget install cs-script

Scoop

scoop bucket add cs-script https://github.com/oleg-shilo/cs-script
scoop install cs-script

Manual (Any OS)

Just unpack the corresponding 7z file and start using the script engine executable cscs.

When using on Windows, you can build an alias(shim) exe css.exe for an easy launch of the script engine process: cscs -self-alias.
The same shim is created if you are installing the CS-Script as a choco package.

Barebone distribution

The minimalistic manual distro on the target machine with .NET SDK installed is just a set of the script engine files:

Linux

cscs.dll
cscs.runtimeconfig.json

Running: dotnet ./cscs.dll <script>

You can also create an alias for convenient access:

echo "alias css='dotnet /usr/local/bin/cs-script/cscs.dll'" >> ~/.bashrc
source ~/.bashrc

And then you can run scripts with a simple: css <script>

Windows

cscs.exe
cscs.dll
cscs.runtimeconfig.json

Running: cscs.exe <script>


Changes

CLI

  • Added auto initialization on the first run of css -vs
  • Added convenient csscript.run(this string app, string args, string dir) to be available to all script files
  • Improved -which
  • Addressed integration issue with Notepad++ when including global_using

CSScriptLib

  • no changes

Release v4.11.5.0-pre

18 Oct 11:34

Choose a tag to compare

Release v4.11.5.0-pre Pre-release
Pre-release

Changes

CLI

  • Added auto initialization on the first run of css -vs
  • Added convenient csscript.run(this string app, string args, string dir) to be available to all script files
  • Improved -which

CSScriptLib

  • no changes

Release v4.11.4.0

15 Oct 12:16

Choose a tag to compare

Note

Windows Defender often marks zip files as infected for no reason. Use VirisTotal reports to ensure the safety of any downloaded distributable:

Installing

  • CLI tool:
    dotnet tool install --global cs-script.cli
  • Hosted class library in .NET Project: create the project from any .NET project template and add CS-Script nuget package:
    dotnet add package cs-script.
More Deployment Options (detailed installation Instructions)

Deployment

Any OS

Install as .NET Tool

dotnet tool install --global cs-script.cli

After that, you can invoke the script engine as css.
You may need to add the folder of css to the system PATH, unless .NET SDK setup does it.
It can be one of these, depending on your OS:

  • %USERPROFILE%\. dotnet\tools
  • ~/.dotnet/tools
  • $HOME/.dotnet/tools

Note:

  • Before upgrading the already installed tool, you may need to ensure the script engine is not running. You can do it with a simple command css -kill.
  • You may prefer to enable an optional build server (see css -server ?) to boost script compilation performance. On Windows, it's done automatically on the very first execution, but on Linux, if you want to use this feature, it needs to be done manually (sudo css -server:add).

Linux

Ubuntu (terminal)

repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.11.2.0/; file=cs-script_4.11-2.deb; rm $file; wget $repo$file; sudo dpkg -i $file

Depending on the user context, you may need to add permissions to the CS-Script temp dir sudo chmod -R 777 /tmp

You can also create a convenient alias (cs-script_x.x-x.deb package does it automatically):

alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+

After that, you can invoke CS-Script engine from anywhere by just typing 'css'.

Note: this very release is not available on Chocolatey and WinGet but only on Nuget (.NET tool) as described above.

Windows

Chocolatey

choco install cs-script

WinGet (pending approval)

winget install cs-script

Scoop

scoop bucket add cs-script https://github.com/oleg-shilo/cs-script
scoop install cs-script

Manual (Any OS)

Just unpack the corresponding 7z file and start using the script engine executable cscs.

When using on Windows, you can build an alias(shim) exe css.exe for an easy launch of the script engine process: cscs -self-alias.
The same shim is created if you are installing the CS-Script as a choco package.

Barebone distribution

The minimalistic manual distro on the target machine with .NET SDK installed is just a set of the script engine files:

Linux

cscs.dll
cscs.runtimeconfig.json

Running: dotnet ./cscs.dll <script>

You can also create an alias for convenient access:

echo "alias css='dotnet /usr/local/bin/cs-script/cscs.dll'" >> ~/.bashrc
source ~/.bashrc

And then you can run scripts with a simple: css <script>

Windows

cscs.exe
cscs.dll
cscs.runtimeconfig.json

Running: cscs.exe <script>


Changes

CLI

  • Added -csproj custom command
  • improved shim detection for Scoop installations

CSScriptLib

  • no changes