CS-Script 4.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package CS-Script --version 4.0.2
NuGet\Install-Package CS-Script -Version 4.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<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
#r "nuget: CS-Script, 4.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. 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

CS-Script engine Class Library for .NET 5

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (20)

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

Package Downloads
WebVella.Erp.Web

The web components library for the open-source and free platform WebVella ERP. It allows a quick and painless creation of business web applications.

WireMock.Net.Matchers.CSharpCode The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

A CSharpCodeMatcher which can be used to match WireMock.Net Requests using C# code.

BioCore

A .NET library & program for annotating, & editing various microscopy imaging formats using Bioformats supported images. including whole slide, pyramidal & series.

BioGTK

A .NET application & library for editing & annotating various microscopy image formats. Supports all bioformats supported images. Integrates with ImageJ, running ImageJ filters & macro functions. Supports Windows, Linux and Mac.

H.Runners.CSharpRunner

Allows you dynamic execution of C# code.

GitHub repositories (9)

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

Repository Stars
dotnetcore/Magicodes.IE
Import and export general library, support Dto import and export, template export, fancy export and dynamic export, support Excel, Csv, Word, Pdf and Html.
antonpup/Aurora
Unified lighting effects across multiple brands and various games.
WireMock-Net/WireMock.Net
WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.
WebVella/WebVella-ERP
Free and open-source pluggable ERP and CRM software based on ASP.NET Core 5, RazorPages and PostgreSQL . Targets Linux or Windows as host OS.
IoTSharp/IoTSharp
IoTSharp is an open-source IoT platform for data collection, processing, visualization, and device management.
Version Downloads Last updated
4.8.14 11,644 1/16/2024
4.8.13 5,083 12/20/2023
4.8.12 1,061 12/16/2023
4.8.10 2,926 11/25/2023
4.8.9 537 11/24/2023
4.8.8 2,018 11/15/2023
4.8.7 836 11/7/2023
4.8.4-pre 127 10/4/2023
4.8.3 7,911 10/1/2023
4.8.1 9,790 7/7/2023
4.8.0 385 7/5/2023
4.6.5 16,256 3/19/2023
4.6.2 50,660 1/2/2023
4.5.0 3,253 12/15/2022
4.4.6 60,013 6/8/2022
4.4.5 10,261 5/15/2022
4.4.4-pre 174 4/23/2022
4.4.2 38,299 4/16/2022
4.4.1 27,839 2/14/2022
4.4.0 605 2/12/2022
4.3.0 2,928 1/15/2022
4.2.0 12,543 11/14/2021
4.1.3-pre 255 9/26/2021
4.1.2-pre 415 9/12/2021
4.1.1-pre 312 9/12/2021
4.1.0 33,993 7/18/2021
4.0.2 2,130 6/16/2021
4.0.1 3,617 4/13/2021
4.0.0 31,318 3/16/2021
3.30.5.1 4,734 12/21/2020
3.30.5-pre 314 12/20/2020
3.30.4 3,061 12/12/2020
3.30.3 21,749 5/30/2020
3.30.2-HotFix 1,205 4/27/2020
3.30.1-HotFix 8,998 12/17/2019
3.30.0 86,937 10/14/2019
3.29.0 286,154 5/22/2019
3.28.7 12,072 9/2/2018
3.28.4 31,421 4/28/2018
3.28.2 2,346 3/15/2018
3.28.0.1 4,449 2/5/2018
3.28.0 2,387 2/4/2018
3.27.2 4,527 8/11/2017
3.27.0 1,644 7/19/2017
3.26.2 3,113 6/30/2017
3.25.1.1 2,873 3/30/2017
3.25.1 1,272 3/23/2017
3.24.2 16,663 3/5/2017
3.24.0 2,058 2/14/2017
3.22.0 1,664 1/30/2017
3.21.1 1,300 1/25/2017
3.19.0 2,888 12/12/2016
3.18.1 2,562 11/16/2016
3.16.0 1,784 10/26/2016
3.14.0 9,089 8/3/2016
3.13.2 28,328 7/7/2016
3.13.1 1,194 7/7/2016
3.12.3 5,269 5/16/2016
3.12.2.1 2,789 5/14/2016
3.12.1 2,175 3/30/2016
3.12.0.1 5,056 3/22/2016
3.12.0 1,630 3/22/2016
3.11.0.1 9,302 2/4/2016
3.11.0 1,345 2/3/2016
3.10.0 1,836 1/12/2016
3.9.19 9,061 12/9/2015
3.9.17 29,675 11/4/2015
3.9.10 21,554 5/6/2015
3.9.8.1 1,703 4/26/2015
3.9.8 1,418 4/25/2015
3.9.7 1,678 4/16/2015
3.9.5 1,946 3/18/2015
3.9.4.1 2,473 2/25/2015
3.9.2 1,788 1/31/2015
3.8.10 20,179 10/20/2014
3.8.8 7,693 9/23/2014
3.8.7 1,471 9/17/2014
3.8.6 2,000 8/30/2014
3.8.5 1,528 8/25/2014
3.8.3 3,138 6/20/2014
3.8.2 1,484 6/15/2014
3.7.2 4,738 2/9/2014
3.7.0 1,607 1/20/2014
3.6.7 3,965 10/29/2013
3.6.2 2,050 8/31/2013
3.5.9 25,711 5/4/2013
3.5.8 1,492 5/3/2013
3.5.7 1,470 5/3/2013
3.5.6 1,473 5/3/2013
3.5.5 1,481 5/1/2013
3.5.4 1,628 4/30/2013
3.5.3 1,591 4/29/2013
3.5.0.2 3,949 2/2/2013
3.5.0.1 1,420 2/2/2013
3.5.0 1,912 2/2/2013
3.2.5.1 10,291 1/21/2012
3.2.5 2,335 1/21/2012

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...");

 ```