Skip to content

Releases: oleg-shilo/cs-script

Release v3.21.0

25 Jan 05:35
Compare
Choose a tag to compare
Release v3.21.0 Pre-release
Pre-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).

Release v3.20.0

09 Jan 00:40
Compare
Choose a tag to compare

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


  • Fixed problem with Console.OutputEncoding not being set correctly for script surrogate host (e.g. //css_host /platform:x86)
  • Added default option to resolve in the compile errors text the all references to the derived auto-generated files (e.g. errors in the decorated classless scripts) with the path of the original files (e.g. classless script itself).
  • Improved help documentation
  • Added .NET ver printout for -ver
  • Added injection of dbg.print object dumper to the console scripts (see details in the next section).
  • Mono evaluator migrated to Mono.CSharp.dll v4.6.57.0
  • Conditionally disabled Linux incompatible routines
  • Improved handling -proj switch by incorporating -l evaluation
  • Improved handling invalid "-help [cmd]" CLI commands
  • Issue#24. Implemented single step conversion of *.resx into *.resources with //css_res.
  • Added "contextData["CompilerOptions"] = options.compilerOptions;" for precompilers

Starting from this release CS-Script will always inject into a console mode scripts a special tiny class dbg for convenient evaluation of the runtime objects. This feature is particularly useful when you are executing the scripts in the environments where debugger is unavailable.

Now you you can call dbg.print for any runtime object and it will print a dump of the tree of the object members and their values:

using System.IO;
using System;
using static dbg;

class Script
{
    static public void Main(string[] args)
    {
        var info = new DirectoryInfo(Environment.CurrentDirectory); 
        print(info);
    }
}

The code above will produce the following output:


{E:\cs-script\samples}
  .Attributes = Directory
  .CreationTime = {13/04/2011 9:25:49 PM}
  .CreationTimeUtc = {13/04/2011 11:25:49 AM}
  .Exists = True
  .Extension = ""
  .FullName = "E:\cs-script\samples"
  .LastAccessTime = {7/01/2017 4:09:06 PM}
  .LastAccessTimeUtc = {7/01/2017 5:09:06 AM}
  .LastWriteTime = {7/01/2017 4:09:06 PM}
  .LastWriteTimeUtc = {7/01/2017 5:09:06 AM}
  .Name = "samples"
  .Parent = {cs-script}
  .Root = {E:\}
  .DisplayPath = "E:\cs-script\samples"
  .FullPath = "E:\cs-script\samples"
  .OriginalPath = "E:\cs-script\samples"
  .UnsafeGetFullName = "E:\cs-script\samples"
  .demandDir = {System.String[]}
  ._data = Microsoft.Win32.Win32Native+WIN32_FILE_ATTRIBUTE_DATA
  ._dataInitialised = 0

Release v3.19.0

12 Dec 05:23
Compare
Choose a tag to compare

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.


  • Fixed problem with CSScript.GlobalSettings.InMemoryAssembly not being processed in CSScript.CacheEnabled = true cases. Affected only CSScriptLibrary.dll
  • Optimized RemovePathDuplicates implementation.
  • Added CSharpParser.SupressCodeAnalysis flag for profiling purposes.
  • Added u-test for CodeDOMEvaluator unsafe delegate creation
  • Added support for -wait switch: "Waits for user input after the execution before exiting."
  • Added support for -wait switch: "Waits for user input after the execution before exiting."
  • Minor runtime output improvement.
  • Fixed problem with '-dbg' switch not being correctly interpreted on args parsing

Release v3.18.0

15 Nov 04:49
Compare
Choose a tag to compare

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.


  • CLI improvements
    • Added -dir:show to print all configured probing directories
    • Reimplemented 'CLI help' support to be consistent with Linux convention.
    • Added support for -help commands to print list of available commands
    • Added support for -syntax to print documentation for CS-Script specific C# syntax.
  • Issue#19: Using wide wildcards in //css_inc can be improved
  • Added loosely coupled ScriptParser.AgregateReferences
  • Added printing a context specific error (with instructions on how to fix) on 'script not found' error
  • In verbose mode in the probing dirs list added top order current_dir item
  • Improved OnExit-cleanup algorithm
    • CSScript.CleanupDynamicSources is scheduled for more reliable AppDomain.CurrentDomain.ProcessExit.
    • Improved Cache management CSScript.CleanupDynamicSources made public.

Release v3.17.0

30 Oct 06:48
Compare
Choose a tag to compare

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.


  • Settings.InMemoryAssembly set true by default
  • Settings.ConcurrencyControl is made persistent
  • Re-enabled (win only) synchronization generating the source for AssemblyDescriptionAttribute
  • Implemented embedded cache operations from CLI

Release v3.16.0.0

26 Oct 00:36
Compare
Choose a tag to compare

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.


Release v3.16.0

  • added support for dash command line prefix on Windows (e.g. cscs -check script.cs)
  • Extended Linux support. Implemented transparent SystemWideLock to achieve system wide mutex Linux.
  • Significantly improved "clean up" algorithm to allow minimal or zero footprint of a fixed (not growing) size.
  • Added Settings.ConcurrencyControl (Standard, HighResolution, None)
  • Added support for "-check" - Check script fro errors without execution.
  • Issues#14: "It should be possible to disable injection of script AssemblyAttribute." Solution: Added setting InjectScriptAssemblyAttribute.
  • Added probing NuGet dirs in NoCache mode
  • Fixed unintended disabling of caching
  • Obsolete ResolveSourceFileHandler demoted to error.

Release v3.15.1.0

19 Oct 04:54
Compare
Choose a tag to compare

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.


Release v3.15.0.0-3.15.1.0

3.15.1.0

  • All LoadCodeFrom are made obsolete
  • Added setting "EntryScriptAssembly" envvar

3.15.0.0

  • Added "System" as a default ref assembly on Linux
  • Implemented setting environment variable <"location:" + assembly.GetHashCode()> at startup to allow discovering the compiled script assembly file for in-memory assembly loading cases.
  • Implemented -out: command line option.
  • Issues#11: "Linux requires -c switch" - added support for disabling caching from command line args -c:<0:|1>
  • Issues#13: "Persistent Caching Bug" - added extra code documentation

Release v3.14.0.0-3.14.1.0

12 Aug 13:28
Compare
Choose a tag to compare

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.


It is essentially repackaged Release v3.14.0.0 that has updated version of the third-party dependency module (niget.exe).

v3.14.1.0

  • Updated nuget.exe (v3.4.4)
  • Added "Updated Nuget" button to the ConfigConsole
  • Implemented 'updated nuget' CLI use-case: cscs updatenugetexe

v3.14.0.0

  • Issue #7: Have a way to import all the script files in a directory (Support for //css_inc sub*.cs)
  • Issue #6: CodeCom Evaluator gets slower after many LoadCode iterations (removed test code)
  • Reinstated WPF support/sample

Release v3.14.0.0

03 Aug 11:20
Compare
Choose a tag to compare

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.


  • Issue #7: Have a way to import all the script files in a directory (Support for //css_inc sub*.cs)
  • Issue #6: CodeCom Evaluator gets slower after many LoadCode iterations (removed test code)
  • Reinstated WPF support/sample

Release v3.13.4.0 - HotFixes

01 Aug 11:30
Compare
Choose a tag to compare
Pre-release

This is a preview release for the new features and fixes.

  • Issue #7: Have a way to import all the script files in a directory (Support for //css_inc sub*.cs)
  • Issue #6: CodeCom Evaluator gets slower after many LoadCode iterations (removed test code)
  • Reinstated WPF support/sample

Please avoid using WinZip or WinRar as they lead to locking the downloaded content. Use 7zip instead.