Skip to content

Release v3.21.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@oleg-shilo oleg-shilo released this 25 Jan 05:35
· 824 commits to master since this release

Use choco install cs-script to deploy the release (instructions on how to use/enable choco).
If you prefer manual install then avoid using WinZip or WinRar as they lead to locking the downloaded content. Use 7zip instead.

Extension Pack contains some additional content representing somewhat less mainstream functionality and experimental features. For installing it extract cs-script.ExtensionPack.7z archive to your install location (e.g. C:\ProgramData\chocolatey\lib\cs-script\tools\cs-script).


The most important features of this release are related to the Linux and Mono integration. Another important change are the features that improve user experience of using CS-Script on it's own without advanced tools (e.g. Visual Studio).

  • Linux gains NuGet support.
  • Finally you can execute C# 6 scripts with Mono evaluator (previously only CS-Script's CodeDom and Roslyn engines supported that):
CSScript.EvaluatorConfig.Engine = EvaluatorEngine.Mono

dynamic script = CSScript.Evaluator
                          .LoadMethod(@"using System;
                                        public void Print(object a, object b)
                                        {
                                            Console.WriteLine($"{a} {b}");
                                        }");

script.Print(1, 2);
  • The Python-like "print" functionality has been extended to support collections:
using System;
using System.IO;

void main()
{
    print(Directory.GetFiles(".", "*"));
}

Will produce:

Script: E:\Dev\test.cs
------------------------------------------------------------------------
[Started pid: 6508]
{string[]} - Length: 4 items
  [0]: ".\mp4_rename.cs"
  [1]: ".\mp4_retag.cs"
  [2]: ".\Script.cs"
  [3]: ".\test.cs"

[Execution completed]

All changes:

  • Added support for C#6 syntax to Mono evaluator.
  • Issue #33: Cleanup routine throws ArgumentException
  • Added extending environment variables in all parameters passed from command line.
  • Improved API XML documentation to address some of the Issue #26 concerns.
  • User experience improvements triggered by intensive Linux testing
    • Various improvements for stdout help.
    • Improved reliability of Auto-class decorating algorithm
    • Added support for referencing NuGet packages from the script being executed on Linux
    • Added -noconfig:print and -precompiler:print options for printing the content in stdout.
  • Extended Python-like "print" functionality:
    • Added params concatenation: print(obj1, obj2,...objN)
    • Added pringf for params formatting: printf("Now: {0}", DateTime.Now)
    • added support for collections: print(Directory.GetFiles(".", "*"))
    • Added decorateAutoClassAsCS6 setting for injection using static dbg; into auto-class decoration.
  • Issue#32: Inconsistent time stamp (.dll -vs- .pdb) when using CSScript.CompileFile() with 'debugBuild = true'
  • Added support for output file in //css_res.
  • Implemented supressing elevation during syntax checking (with -check) for the scripts with //css_pre elevate directive.
  • Improved settings file parsing to avoid throwing handled exceptions.
  • Added support for CSS_RESGEN environment variable for embedding resources with //css_res.
  • Code cleanup
    • Various obsolete code marked as error triggering.
    • Removed old obsolete ResolveSourceFileHandler delegate and MonoEvaluator.Configuration member.
    • Started removal of obsolete .NET1.1 code (conditional compiler directives).