Kephas.Scripting.CSharp 11.1.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. 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.
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.
// Install Kephas.Scripting.CSharp as a Cake Addin
#addin nuget:?package=Kephas.Scripting.CSharp&version=11.1.0

// Install Kephas.Scripting.CSharp as a Cake Tool
#tool nuget:?package=Kephas.Scripting.CSharp&version=11.1.0

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. 
.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 513 4/13/2022
11.1.0-dev.4 127 4/6/2022
11.1.0-dev.3 117 3/30/2022
11.1.0-dev.2 119 3/23/2022
11.1.0-dev.1 112 3/23/2022
11.0.0 487 3/11/2022
11.0.0-dev.7 120 3/7/2022
11.0.0-dev.6 121 2/28/2022
11.0.0-dev.5 119 2/26/2022
11.0.0-dev.4 128 2/24/2022
11.0.0-dev.3 123 2/23/2022
11.0.0-dev.2 125 2/18/2022
11.0.0-dev.1 124 2/7/2022
10.3.0 483 1/18/2022
10.2.0 837 12/3/2021
10.1.0 4,899 11/23/2021
10.1.0-dev.7 178 11/17/2021
10.1.0-dev.6 149 11/16/2021
10.1.0-dev.5 157 11/10/2021
10.1.0-dev.4 148 11/8/2021
10.1.0-dev.3 133 11/8/2021
10.1.0-dev.2 154 11/4/2021
10.1.0-dev.1 152 11/3/2021
10.0.1 422 10/16/2021
10.0.0 394 10/13/2021
10.0.0-dev.4 140 10/13/2021
10.0.0-dev.3 162 10/11/2021
10.0.0-dev.2 210 10/8/2021
9.3.4 373 8/25/2021
9.3.3 367 8/25/2021
9.3.2 379 8/24/2021
9.3.1 365 8/12/2021
9.3.0 393 8/12/2021
9.2.0 391 6/17/2021
9.1.0 408 6/17/2021
9.1.0-dev.9 188 5/26/2021
9.1.0-dev.8 175 5/26/2021
9.1.0-dev.7 179 5/17/2021
9.1.0-dev.6 170 4/28/2021
9.1.0-dev.5 178 4/23/2021
9.1.0-dev.4 186 4/21/2021
9.1.0-dev.3 175 4/17/2021
9.1.0-dev.2 170 4/12/2021
9.1.0-dev.1 232 4/9/2021
9.0.5 377 3/31/2021
9.0.4 422 3/23/2021
9.0.3 413 3/20/2021
9.0.1 386 3/18/2021
9.0.0 400 3/17/2021
9.0.0-dev.4 177 3/4/2021
9.0.0-dev.3 184 3/1/2021
9.0.0-dev.2 205 2/22/2021
8.4.0 442 11/11/2020
8.3.0 445 10/28/2020
8.2.0 523 10/16/2020
8.1.0 562 9/23/2020
8.0.0 501 7/1/2020
8.0.0-dev.44 285 6/25/2020
8.0.0-dev.43 271 6/23/2020
8.0.0-dev.42 299 6/22/2020
8.0.0-dev.41 287 6/18/2020
8.0.0-dev.40 260 6/18/2020
8.0.0-dev.39 279 6/15/2020
8.0.0-dev.38 386 6/14/2020
8.0.0-dev.37 247 6/13/2020
8.0.0-dev.36 294 6/13/2020
8.0.0-dev.35 236 6/12/2020
8.0.0-dev.34 285 6/12/2020
8.0.0-dev.33 328 6/10/2020
8.0.0-dev.32 254 6/1/2020
8.0.0-dev.31 275 6/1/2020
8.0.0-dev.30 347 5/30/2020
8.0.0-dev.28 289 5/28/2020
8.0.0-dev.27 269 5/15/2020
8.0.0-dev.26 250 5/14/2020
8.0.0-dev.25 278 5/14/2020
8.0.0-dev.24 266 5/13/2020
8.0.0-dev.23 271 5/13/2020
8.0.0-dev.22 267 5/13/2020
8.0.0-dev.21 260 5/12/2020
8.0.0-dev.20 265 5/12/2020
8.0.0-dev.19 275 5/7/2020
8.0.0-dev.18 264 5/7/2020
8.0.0-dev.17 263 5/6/2020
8.0.0-dev.16 258 5/6/2020
8.0.0-dev.15 260 5/5/2020
8.0.0-dev.14 257 5/5/2020
8.0.0-dev.13 284 5/4/2020
7.6.0-dev.13 288 5/1/2020
7.6.0-dev.12 292 4/30/2020
7.6.0-dev.11 259 4/28/2020
7.6.0-dev.10 258 4/27/2020
7.6.0-dev.9 252 4/24/2020
7.6.0-dev.8 262 4/22/2020
7.6.0-dev.7 257 4/15/2020
7.6.0-dev.6 253 4/15/2020
7.6.0-dev.5 245 4/15/2020
7.6.0-dev.4 373 4/11/2020
7.6.0-dev.3 251 4/10/2020
7.6.0-dev.2 243 4/10/2020
7.6.0-dev.1 325 4/8/2020
7.5.2 586 3/20/2020
7.5.1 512 3/12/2020
7.5.0 516 3/10/2020
7.5.0-dev.18 283 3/5/2020
7.5.0-dev.17 282 3/5/2020
7.5.0-dev.16 299 3/4/2020
7.5.0-dev.15 244 3/3/2020
7.5.0-dev.14 258 3/3/2020
7.5.0-dev.13 243 2/29/2020
7.5.0-dev.12 366 2/29/2020
7.5.0-dev.10 245 2/25/2020
7.5.0-dev.9 288 2/20/2020
7.5.0-dev.8 317 2/18/2020
7.5.0-dev.7 249 2/18/2020
7.5.0-dev.6 272 2/14/2020
7.5.0-dev.5 293 2/12/2020
7.5.0-dev.4 265 2/11/2020
7.5.0-dev.3 238 2/11/2020
7.5.0-dev.2 381 2/8/2020
7.5.0-dev.1 272 2/7/2020
7.4.2 509 2/5/2020
7.4.1 576 2/3/2020
7.4.0 592 1/31/2020
7.4.0-dev.4 321 1/31/2020
7.4.0-dev.3 299 1/29/2020
7.4.0-dev.2 254 1/28/2020
7.4.0-dev.1 246 1/23/2020
7.3.1 603 1/21/2020
7.3.1-preview.7 257 1/21/2020
7.3.1-preview.1 288 1/20/2020
7.3.0 507 1/19/2020
7.2.6 589 1/18/2020
7.2.5 556 12/19/2019
7.2.4 559 12/19/2019
7.2.3 571 12/16/2019
7.2.2 527 12/9/2019
7.2.1 544 12/4/2019
7.2.0 501 11/26/2019
7.2.0-preview.10 257 11/20/2019
7.2.0-preview.9 260 11/19/2019
7.2.0-preview.8 260 11/18/2019
7.2.0-preview.6 271 11/14/2019
7.2.0-preview.5 266 11/14/2019
7.2.0-preview.4 254 11/14/2019
7.2.0-preview.2 260 11/11/2019
7.2.0-preview.1 261 11/9/2019
7.1.0 548 11/6/2019
7.1.0-preview.8 267 11/5/2019
7.1.0-preview.7 265 11/4/2019
7.1.0-preview.6 263 11/1/2019
7.1.0-preview.5 282 10/31/2019
7.1.0-preview.4 282 10/30/2019
7.1.0-preview.3 268 10/26/2019
7.1.0-preview.2 266 10/25/2019
7.1.0-preview.1 266 10/24/2019
7.0.0 533 10/16/2019
7.0.0-rc.41 272 10/15/2019
7.0.0-rc.40 284 10/15/2019
7.0.0-rc.39 279 10/12/2019
7.0.0-rc.38 270 10/11/2019
7.0.0-rc.37 270 10/10/2019
7.0.0-rc.36 265 10/9/2019
7.0.0-rc.35 266 10/8/2019
7.0.0-rc.34 271 10/8/2019
7.0.0-rc.33 265 10/7/2019
7.0.0-rc.32 262 10/5/2019
7.0.0-rc.31 271 10/3/2019
7.0.0-rc.30 276 10/1/2019
7.0.0-rc.28 276 10/1/2019
7.0.0-rc.27 263 9/30/2019
7.0.0-rc.26 278 9/30/2019
7.0.0-rc.25 262 9/27/2019
7.0.0-rc.24 266 9/27/2019
7.0.0-rc.23 257 9/26/2019
7.0.0-rc.22 269 9/25/2019
7.0.0-rc.21 271 9/24/2019
7.0.0-rc.20 274 9/23/2019
7.0.0-rc.19 264 9/20/2019
7.0.0-rc.18.1 268 9/20/2019
7.0.0-rc.18 275 9/20/2019
6.5.0-rc.17 284 9/19/2019
6.5.0-rc.16 288 9/18/2019
6.5.0-rc.15 288 9/18/2019
6.5.0-rc.14.1 290 9/18/2019
6.5.0-rc.14 283 9/17/2019
6.5.0-rc.13 279 9/16/2019
6.5.0-rc.12.2 280 9/13/2019
6.5.0-rc.12.1 284 9/12/2019
6.5.0-rc.12 285 9/12/2019
6.5.0-rc.11 281 9/11/2019
6.5.0-rc.10 279 9/10/2019
6.5.0-rc.9 276 9/9/2019
6.5.0-rc.8 272 9/6/2019
6.5.0-rc.7 282 9/6/2019
6.5.0-rc.6 283 9/6/2019
6.5.0-rc.5 275 9/2/2019
6.5.0-rc.4 282 9/2/2019
6.5.0-rc.3 270 8/30/2019
6.5.0-rc.2 299 8/29/2019
6.5.0-rc.1 285 8/28/2019
6.5.0-beta.5 290 8/28/2019
6.5.0-beta.4 287 8/27/2019
6.0.0 589 8/6/2019
6.0.0-rc.7 277 7/19/2019
6.0.0-rc.6 286 6/28/2019
6.0.0-rc.5 275 6/28/2019
6.0.0-rc.4 277 6/25/2019
6.0.0-rc.3 289 6/20/2019
6.0.0-rc.2 283 5/29/2019
6.0.0-rc.1 284 5/28/2019
6.0.0-beta.3 296 4/17/2019
5.3.0-beta.2 289 3/21/2019
5.3.0-beta.1 285 3/20/2019
5.2.0 589 3/19/2019
5.1.0 864 1/25/2019
5.0.0 915 12/21/2018
5.0.0-rc11 697 12/14/2018
5.0.0-rc10 554 11/16/2018
5.0.0-rc09 548 11/1/2018
5.0.0-rc08 529 10/31/2018
5.0.0-rc07 560 10/31/2018
5.0.0-rc06 560 10/30/2018
5.0.0-rc05 564 10/29/2018
5.0.0-rc04 585 10/29/2018
5.0.0-rc03 567 10/26/2018
5.0.0-rc02 558 10/25/2018
5.0.0-rc01 590 10/12/2018
5.0.0-beta03 598 9/21/2018
5.0.0-beta02 598 9/10/2018
5.0.0-beta01 601 9/7/2018
4.5.1 893 8/7/2018
4.5.0 871 8/7/2018
4.5.0-rc01 735 6/7/2018
4.5.0-beta09 748 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.