Kephas.Scripting.CSharp 11.1.0

Prefix Reserved
dotnet add package Kephas.Scripting.CSharp --version 11.1.0
                    
NuGet\Install-Package Kephas.Scripting.CSharp -Version 11.1.0
                    
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="Kephas.Scripting.CSharp" Version="11.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kephas.Scripting.CSharp" Version="11.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Kephas.Scripting.CSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Kephas.Scripting.CSharp --version 11.1.0
                    
#r "nuget: Kephas.Scripting.CSharp, 11.1.0"
                    
#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.
#:package Kephas.Scripting.CSharp@11.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Kephas.Scripting.CSharp&version=11.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Kephas.Scripting.CSharp&version=11.1.0
                    
Install as a Cake Tool

C# Scripting

Introduction

The C# scripting area in Kephas handles C# dynamic code execution using Microsoft.CodeAnalysis.CSharp.Scripting.

Check the following packages for more information:

Usage

  • String based script execution
// normally you would get the processor injected into the service constructor.
var processor = injector.Resolve<IScriptProcessor>();

var script = new CSharpStringScript(
@"int Power(int a) => a * a;
return Power((int)value) + 3;
");
var result = await processor.ExecuteAsync(script), new { value = 5 })).PreserveThreadContext();
Assert.Equals(28, result);
  • File based script execution

The file scripts assume that the language can be inferred from the file extension. For C#, it means that the file needs to and with a *.cs or *.csx extension. If this is not the case, make sure you specify the language explicitly when creating a FileScript.

// normally you would get the processor injected into the service constructor.
var processor = injector.Resolve<IScriptProcessor>();

// C# scripts ending with *.csx
var result = await processor.ExecuteAsync(new FileScript("myscript.csx"), new { value = 5 })).PreserveThreadContext();
Assert.Equals(28, result);

// C# scripts not ending with *.csx or *.cs
var result = await processor.ExecuteAsync(new FileScript("myscript.txt", CSharpLanguageService.Language), new { value = 5 })).PreserveThreadContext();
Assert.Equals(28, result);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.1.0 856 4/13/2022
11.1.0-dev.4 259 4/6/2022
11.1.0-dev.3 242 3/30/2022
11.1.0-dev.2 250 3/23/2022
11.1.0-dev.1 245 3/23/2022
11.0.0 660 3/11/2022
11.0.0-dev.7 256 3/7/2022
11.0.0-dev.6 269 2/28/2022
11.0.0-dev.5 270 2/26/2022
11.0.0-dev.4 263 2/24/2022
11.0.0-dev.3 267 2/23/2022
11.0.0-dev.2 263 2/18/2022
11.0.0-dev.1 264 2/7/2022
10.3.0 644 1/18/2022
10.2.0 1,010 12/3/2021
10.1.0 5,077 11/23/2021
10.1.0-dev.7 319 11/17/2021
10.1.0-dev.6 290 11/16/2021
10.1.0-dev.5 294 11/10/2021
10.1.0-dev.4 278 11/8/2021
10.1.0-dev.3 270 11/8/2021
10.1.0-dev.2 296 11/4/2021
10.1.0-dev.1 286 11/3/2021
10.0.1 603 10/16/2021
10.0.0 566 10/13/2021
10.0.0-dev.4 283 10/13/2021
10.0.0-dev.3 297 10/11/2021
10.0.0-dev.2 351 10/8/2021
9.3.4 553 8/25/2021
9.3.3 538 8/25/2021
9.3.2 551 8/24/2021
9.3.1 544 8/12/2021
9.3.0 577 8/12/2021
9.2.0 549 6/17/2021
9.1.0 571 6/17/2021
9.1.0-dev.9 327 5/26/2021
9.1.0-dev.8 315 5/26/2021
9.1.0-dev.7 327 5/17/2021
9.1.0-dev.6 313 4/28/2021
9.1.0-dev.5 321 4/23/2021
9.1.0-dev.4 329 4/21/2021
9.1.0-dev.3 320 4/17/2021
9.1.0-dev.2 318 4/12/2021
9.1.0-dev.1 382 4/9/2021
9.0.5 561 3/31/2021
9.0.4 592 3/23/2021
9.0.3 608 3/20/2021
9.0.1 575 3/18/2021
9.0.0 589 3/17/2021
9.0.0-dev.4 329 3/4/2021
9.0.0-dev.3 338 3/1/2021
9.0.0-dev.2 357 2/22/2021
8.4.0 629 11/11/2020
8.3.0 644 10/28/2020
8.2.0 720 10/16/2020
8.1.0 759 9/23/2020
8.0.0 698 7/1/2020
8.0.0-dev.44 446 6/25/2020
8.0.0-dev.43 438 6/23/2020
8.0.0-dev.42 460 6/22/2020
8.0.0-dev.41 460 6/18/2020
8.0.0-dev.40 428 6/18/2020
8.0.0-dev.39 440 6/15/2020
8.0.0-dev.38 552 6/14/2020
8.0.0-dev.37 414 6/13/2020
8.0.0-dev.36 464 6/13/2020
8.0.0-dev.35 399 6/12/2020
8.0.0-dev.34 442 6/12/2020
8.0.0-dev.33 491 6/10/2020
8.0.0-dev.32 415 6/1/2020
8.0.0-dev.31 434 6/1/2020
8.0.0-dev.30 506 5/30/2020
8.0.0-dev.28 451 5/28/2020
8.0.0-dev.27 438 5/15/2020
8.0.0-dev.26 419 5/14/2020
8.0.0-dev.25 443 5/14/2020
8.0.0-dev.24 436 5/13/2020
8.0.0-dev.23 435 5/13/2020
8.0.0-dev.22 437 5/13/2020
8.0.0-dev.21 434 5/12/2020
8.0.0-dev.20 432 5/12/2020
8.0.0-dev.19 440 5/7/2020
8.0.0-dev.18 440 5/7/2020
8.0.0-dev.17 438 5/6/2020
8.0.0-dev.16 433 5/6/2020
8.0.0-dev.15 428 5/5/2020
8.0.0-dev.14 428 5/5/2020
8.0.0-dev.13 458 5/4/2020
7.6.0-dev.13 458 5/1/2020
7.6.0-dev.12 459 4/30/2020
7.6.0-dev.11 423 4/28/2020
7.6.0-dev.10 432 4/27/2020
7.6.0-dev.9 414 4/24/2020
7.6.0-dev.8 433 4/22/2020
7.6.0-dev.7 427 4/15/2020
7.6.0-dev.6 416 4/15/2020
7.6.0-dev.5 424 4/15/2020
7.6.0-dev.4 542 4/11/2020
7.6.0-dev.3 422 4/10/2020
7.6.0-dev.2 413 4/10/2020
7.6.0-dev.1 489 4/8/2020
7.5.2 775 3/20/2020
7.5.1 711 3/12/2020
7.5.0 721 3/10/2020
7.5.0-dev.18 448 3/5/2020
7.5.0-dev.17 457 3/5/2020
7.5.0-dev.16 465 3/4/2020
7.5.0-dev.15 411 3/3/2020
7.5.0-dev.14 421 3/3/2020
7.5.0-dev.13 414 2/29/2020
7.5.0-dev.12 532 2/29/2020
7.5.0-dev.10 409 2/25/2020
7.5.0-dev.9 462 2/20/2020
7.5.0-dev.8 482 2/18/2020
7.5.0-dev.7 418 2/18/2020
7.5.0-dev.6 436 2/14/2020
7.5.0-dev.5 474 2/12/2020
7.5.0-dev.4 429 2/11/2020
7.5.0-dev.3 412 2/11/2020
7.5.0-dev.2 551 2/8/2020
7.5.0-dev.1 436 2/7/2020
7.4.2 712 2/5/2020
7.4.1 784 2/3/2020
7.4.0 791 1/31/2020
7.4.0-dev.4 485 1/31/2020
7.4.0-dev.3 464 1/29/2020
7.4.0-dev.2 417 1/28/2020
7.4.0-dev.1 411 1/23/2020
7.3.1 814 1/21/2020
7.3.1-preview.7 424 1/21/2020
7.3.1-preview.1 453 1/20/2020
7.3.0 714 1/19/2020
7.2.6 791 1/18/2020
7.2.5 749 12/19/2019
7.2.4 760 12/19/2019
7.2.3 762 12/16/2019
7.2.2 727 12/9/2019
7.2.1 749 12/4/2019
7.2.0 701 11/26/2019
7.2.0-preview.10 422 11/20/2019
7.2.0-preview.9 428 11/19/2019
7.2.0-preview.8 426 11/18/2019
7.2.0-preview.6 443 11/14/2019
7.2.0-preview.5 440 11/14/2019
7.2.0-preview.4 422 11/14/2019
7.2.0-preview.2 427 11/11/2019
7.2.0-preview.1 423 11/9/2019
7.1.0 751 11/6/2019
7.1.0-preview.8 437 11/5/2019
7.1.0-preview.7 430 11/4/2019
7.1.0-preview.6 426 11/1/2019
7.1.0-preview.5 450 10/31/2019
7.1.0-preview.4 450 10/30/2019
7.1.0-preview.3 436 10/26/2019
7.1.0-preview.2 443 10/25/2019
7.1.0-preview.1 435 10/24/2019
7.0.0 728 10/16/2019
7.0.0-rc.41 444 10/15/2019
7.0.0-rc.40 459 10/15/2019
7.0.0-rc.39 443 10/12/2019
7.0.0-rc.38 437 10/11/2019
7.0.0-rc.37 434 10/10/2019
7.0.0-rc.36 430 10/9/2019
7.0.0-rc.35 435 10/8/2019
7.0.0-rc.34 440 10/8/2019
7.0.0-rc.33 434 10/7/2019
7.0.0-rc.32 427 10/5/2019
7.0.0-rc.31 438 10/3/2019
7.0.0-rc.30 443 10/1/2019
7.0.0-rc.28 443 10/1/2019
7.0.0-rc.27 435 9/30/2019
7.0.0-rc.26 443 9/30/2019
7.0.0-rc.25 428 9/27/2019
7.0.0-rc.24 428 9/27/2019
7.0.0-rc.23 421 9/26/2019
7.0.0-rc.22 442 9/25/2019
7.0.0-rc.21 443 9/24/2019
7.0.0-rc.20 439 9/23/2019
7.0.0-rc.19 436 9/20/2019
7.0.0-rc.18.1 436 9/20/2019
7.0.0-rc.18 442 9/20/2019
6.5.0-rc.17 462 9/19/2019
6.5.0-rc.16 458 9/18/2019
6.5.0-rc.15 467 9/18/2019
6.5.0-rc.14.1 462 9/18/2019
6.5.0-rc.14 460 9/17/2019
6.5.0-rc.13 450 9/16/2019
6.5.0-rc.12.2 446 9/13/2019
6.5.0-rc.12.1 455 9/12/2019
6.5.0-rc.12 452 9/12/2019
6.5.0-rc.11 456 9/11/2019
6.5.0-rc.10 442 9/10/2019
6.5.0-rc.9 438 9/9/2019
6.5.0-rc.8 447 9/6/2019
6.5.0-rc.7 446 9/6/2019
6.5.0-rc.6 448 9/6/2019
6.5.0-rc.5 443 9/2/2019
6.5.0-rc.4 452 9/2/2019
6.5.0-rc.3 442 8/30/2019
6.5.0-rc.2 466 8/29/2019
6.5.0-rc.1 452 8/28/2019
6.5.0-beta.5 460 8/28/2019
6.5.0-beta.4 451 8/27/2019
6.0.0 797 8/6/2019
6.0.0-rc.7 450 7/19/2019
6.0.0-rc.6 455 6/28/2019
6.0.0-rc.5 443 6/28/2019
6.0.0-rc.4 450 6/25/2019
6.0.0-rc.3 456 6/20/2019
6.0.0-rc.2 451 5/29/2019
6.0.0-rc.1 455 5/28/2019
6.0.0-beta.3 467 4/17/2019
5.3.0-beta.2 468 3/21/2019
5.3.0-beta.1 459 3/20/2019
5.2.0 787 3/19/2019
5.1.0 1,213 1/25/2019
5.0.0 1,271 12/21/2018
5.0.0-rc11 1,030 12/14/2018
5.0.0-rc10 778 11/16/2018
5.0.0-rc09 775 11/1/2018
5.0.0-rc08 745 10/31/2018
5.0.0-rc07 781 10/31/2018
5.0.0-rc06 779 10/30/2018
5.0.0-rc05 776 10/29/2018
5.0.0-rc04 809 10/29/2018
5.0.0-rc03 791 10/26/2018
5.0.0-rc02 786 10/25/2018
5.0.0-rc01 827 10/12/2018
5.0.0-beta03 833 9/21/2018
5.0.0-beta02 841 9/10/2018
5.0.0-beta01 836 9/7/2018
4.5.1 1,251 8/7/2018
4.5.0 1,232 8/7/2018
4.5.0-rc01 1,235 6/7/2018
4.5.0-beta09 1,216 6/7/2018

Please check https://github.com/kephas-software/kephas/releases for the change log.
           Also check the documentation and the samples from https://github.com/kephas-software/kephas/wiki and https://github.com/kephas-software/kephas/tree/master/Samples.