CS-Script 4.0.2

CS-Script engine Class Library for .NET 5

Install-Package CS-Script -Version 4.0.2
dotnet add package CS-Script --version 4.0.2
<PackageReference Include="CS-Script" Version="4.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CS-Script --version 4.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CS-Script, 4.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install CS-Script as a Cake Addin
#addin nuget:?package=CS-Script&version=4.0.2

// Install CS-Script as a Cake Tool
#tool nuget:?package=CS-Script&version=4.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

Minor usability improvements of CSScriptLib:

- Unloading script assembly.
  _After .NET Framework ignoring the problem for ~14 years .NET Core fillally allows this feature to be implemented._
- Excluding assemblies from being auto referenced (assembly filtering).
- Implemented script caching that was available in the CS-Script edition for .NET Franework.

---

## Deployment
_**Ubuntu (terminal)**_
```
repo=https://github.com/oleg-shilo/cs-script/releases/download/v4.0.2.0/; file=cs-script_4.0-2.deb; rm $file; wget $repo$file; sudo dpkg -i $file
```
_**Windows (choco)**_
_Pending approval_
```
choco install cs-script --version=4.0.2.0
```
It is highly recommended that you uninstall CS-Script.Core:
```
sudo choco uninstall cs-script.core
```

_**Manual**_
Just unpack the corresponding 7z file and start using the script engine executable `cscs`.
If you prefer you can build a shim exe `css` for an easy launch of the script engine process:
```
cscs -self-exe
```
The same shim/symbolic link is created if you are installing the CS-Script as a package.

---
## Changes

### CLI

_No changes_

### CSScriptLib

- Added support for filtering referenced assemblies:
 ```C#
 dynamic script = CSScript
                      .Evaluator
                      .SetRefAssemblyFilter(asms =>
                          asms.Where(a => !a.FullName.StartsWith("Microsoft."))
                      .LoadCode(scriptCode);
 ```

- Added extension method for unloading script assembly after the execution
 ```C#
 ICalc calc = evaluator
                 .With(eval => eval.IsAssemblyUnloadingEnabledled = true)
                 .LoadMethod<ICalc>("int Sum(int a, int b) => a+b;");

 var result = calc.Sum(7, 3);

 calc.GetType()
     .Assembly
     .Unload();
 ```

- Added script caching. If caching is enabled (disabled by default) the script is to be recompiled only if it is changes since the last execution. It applies to both execution if script file and script code.
 ```C#
 dynamic script = CSScript.Evaluator
                          .With(eval => eval.IsCachingEnabled = true)
                          .LoadMethod(@"object print(string message)
                                        {
                                            Console.WriteLine(message);
                                        }");

 script.print("Hello...");

 ```

NuGet packages (8)

Showing the top 5 NuGet packages that depend on CS-Script:

Package Downloads
ClrPlus.Scripting.MsBuild
A library containing classes to use propertysheets with MsBuild scripts. [Note: This library is not quite ready for public consumption--I'm in the middle of some code reorganization]
H.Runners.CSharpRunner
Allows you dynamic execution of C# code.
WireMock.Net.Matchers.CSharpCode
A CSharpCodeMatcher which can be used to match WireMock.Net Requests using C# code.
ReMi.Api
ReMi API
GrinderScript.Net.CsScript
Support for writing load test as pure C# scripts using CS-Script for GrinderScript.Net

GitHub repositories (6)

Showing the top 5 popular GitHub repositories that depend on CS-Script:

Repository Stars
antonpup/Aurora
Unified lighting effects across multiple brands and various games.
fdorg/flashdevelop
FlashDevelop is a free and open source code editor.
WireMock-Net/WireMock.Net
WireMock.Net is a flexible library for stubbing and mocking web HTTP responses using request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.
dukus/digiCamControl
DSLR camera remote control open source software
SparkDevNetwork/Rock
An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.

Version History

Version Downloads Last updated
4.0.2 83 6/16/2021
4.0.1 1,463 4/13/2021
4.0.0 1,013 3/16/2021
3.30.5.1 1,769 12/21/2020
3.30.5-pre 148 12/20/2020
3.30.4 891 12/12/2020
3.30.3 4,021 5/30/2020
3.30.2-HotFix 1,050 4/27/2020
3.30.1-HotFix 8,821 12/17/2019
3.30.0 49,636 10/14/2019
3.29.0 107,134 5/22/2019
3.28.7 8,067 9/2/2018
3.28.4 19,283 4/28/2018
3.28.2 1,647 3/15/2018
3.28.0.1 2,282 2/5/2018
3.28.0 1,048 2/4/2018
3.27.2 3,764 8/11/2017
3.27.0 1,046 7/19/2017
3.26.2 2,092 6/30/2017
3.25.1.1 2,365 3/30/2017
3.25.1 761 3/23/2017
3.24.2 6,273 3/5/2017
3.24.0 1,347 2/14/2017
3.22.0 1,153 1/30/2017
3.21.1 804 1/25/2017
3.19.0 2,323 12/12/2016
3.18.1 1,780 11/16/2016
3.16.0 1,222 10/26/2016
3.14.0 6,189 8/3/2016
3.13.2 14,906 7/7/2016
3.13.1 686 7/7/2016
3.12.3 3,734 5/16/2016
3.12.2.1 1,817 5/14/2016
3.12.1 1,623 3/30/2016
3.12.0.1 4,100 3/22/2016
3.12.0 889 3/22/2016
3.11.0.1 8,650 2/4/2016
3.11.0 845 2/3/2016
3.10.0 1,213 1/12/2016
3.9.19 4,897 12/9/2015
3.9.17 5,374 11/4/2015
3.9.10 15,797 5/6/2015
3.9.8.1 930 4/26/2015
3.9.8 765 4/25/2015
3.9.7 1,100 4/16/2015
3.9.5 1,399 3/18/2015
3.9.4.1 1,587 2/25/2015
3.9.2 1,247 1/31/2015
3.8.10 13,021 10/20/2014
3.8.8 3,554 9/23/2014
3.8.7 992 9/17/2014
3.8.6 1,476 8/30/2014
3.8.5 968 8/25/2014
3.8.3 2,553 6/20/2014
3.8.2 955 6/15/2014
3.7.2 3,734 2/9/2014
3.7.0 1,095 1/20/2014
3.6.7 3,355 10/29/2013
3.6.2 1,490 8/31/2013
3.5.9 23,429 5/4/2013
3.5.8 955 5/3/2013
3.5.7 941 5/3/2013
3.5.6 958 5/3/2013
3.5.5 956 5/1/2013
3.5.4 1,108 4/30/2013
3.5.3 1,048 4/29/2013
3.5.0.2 3,261 2/2/2013
3.5.0.1 882 2/2/2013
3.5.0 1,184 2/2/2013
3.2.5.1 4,308 1/21/2012
3.2.5 1,492 1/21/2012