Releases: oleg-shilo/cs-script
Release v3.26.1.0
Use choco install cs-script
to deploy the release (instructions on how to use/enable choco). Note: it may take some time before the release will appear on Chocolatey.
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).
v3.26.1.0
- Issue #73: In 3.26.0.0 running default install gives error about alternative compiler
- Issue #71: Issue with multiple indirect relative paths
v3.26.0.0
The most notable features of this release are the significant usability improvements particularly for supporting C# 7 on Mono/Linux. As well as the features triggered by VSCode integration.
-
Linux support
- Added "/debug:pdbonly" workaround to allow generation of debug symbols on Linux+Mono. Needed as Mono "/debug+" is broken on Linux.
- Added resolving GAC assemblies from namespaces Mono/Linux
- Added on-fly conversion of *.pdb to *.mdb under Mono
- Patched Microsoft.CodeDom.Providers.DotNetCompilerPlatform to allow using Roslyn on Linux. This work around allows custom compiler (csc.exe) path and handles Mono problem when interfacing Roslyn (C#7). This is a work around for https://bugzilla.xamarin.com/show_bug.cgi?id=57130
- Moved lock objects (*.lock files) on Linux away (to cache) from the actual folders where the files to be locked are. Just to stop pouting the file system
-
Deployment
- Default CS-Script code provider renamed to CSSRoslynProvider.dll.
- Default code provider CSSRoslynProvider.dll embeds patched Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll to allow simplified low footprint deployment.
- Added auto-loading CSSRoslynProvider.dll if found in the script engine folder.
- Added resolving code provider when it is specified by file name without extension
-
C# 7 and general improvements
dbg.print
extended with direct support for IDictionary.- Added alias to the '-provider' switch: '-pvdr'
- Added fully named equivalent of '-s' switch: '-sample'
- Added C# 7 specific sample with '-s:7' switch
- Added '-tc' switch for tracing the actual compiler input for CSSRoslynProvider.dll
- Script engine assembly (e.g. cscs.exe) has been exposed to the precompiler routines.
- Added ScriptParser.ProcessImportedScript to be used from precompilers.
-
VSCode integration features
- Added -stop CLI switch to stop Roslyn server if any active.
- Added option to inject breakpoint into autoclass decoration with -ac:* switch.
- Added Settings.RoslynDir.
- Added 'dbg' methods extensions.
- Added option to include injected dbg.cs file into script project printout
-
Assorted defect fixes
Release v3.25.3.0
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).
- Added support for resolving NuGet packages from the
netstandard
lib subfolders - Added defaultRefAssemblies exchange in InitExecuteOptions()
- .NET Core support (RC)
- Issue #61: Issues with caching; Sample:
CSScript.GlobalSettings.LegacyTimestampCaching = false;
(default isfalse
) - Added support for
//css_ac_end
to allow Extension methods in classless scripts - Implemented caching for InMemory script assemblies
- Fixed collapsing spaces in the DefaulrRefAssemblies settings value
The most important features of this release are
.NET Core - Release Candidate
The CS-Script functionality for .NET Core is bound to (defined by) the scope of the currently implemented Reflection namespace found in .NET Core. Thus some CS-Script features are not ported yet. They will be as soon as .NET Core completes and releases currently missing functionality.
The full set of supported features is presented in this test code.
The binary will be published on NuGet soon.
Changes in the script caching/timestamping algorithm.
Prompted by Issue #61 CS-Script timestamp-based caching algorithm has been updated to avoid modifying compiled assemblies LastModifiedTime file attribute. Now the timestamp is injected in the assembly cs-script metadata instead of being saved as a file attribute. If for whatever reason the old believer is required you can always re-enable it as follows:
CSScript.GlobalSettings.LegacyTimestampCaching = false;
Alternatively you can set CSS_LEGACY_TIMESTAMP_CACHING
environment variable to true
.
Support for extension methods in classless scripts
Before this release it was impossible to have extension methods in the classless scripts due to the fact that the whole script code is wrapped in the on-fly class definition. Thus none of the extension methods from the classless script can be in a top-level class definitions but rather a nested class definition instead. This causes a compile error for the obvious reason.
space
To avoid this limitation a special directive //css_ac_end
has been introduced. This directive indicates the end of the auto-class (classless) script so the runtime stops decorating any code after that directive.
//css_args -ac
using System;
void main()
{
Console.WriteLine("\textension\ttest".TabToSpaces());
}
//css_ac_end
static class Extensions
{
public static string TabToSpaces(this string text, string replacement = " ")
{
return text.Replace("\t", replacement);
}
}
Release v3.25.1.0
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).
- Added support for C# 7.
In order to activate it you need to adjust the default settings to use CS-Script code provider:
cscs -config:set:UseAlternativeCompiler:%CSSCRIPT_DIR%\lib\CSSCodeProvider.v4.6.dll
Read more here - Assorted defect fixed
- Added setting
LastCompilingResult
even when compiling script has failed. - Issue #56: Concurrency control for hosted scripts needs to be system wide
- Issue #47: Error while compiling related to environment block
- Added CSScript.IgnoreSystemWideConfig()
- Disabled "dbg.print" triggered injection of System.Linq/Core on Linux
- Disabled dbg.cs inclusion if dbg.print is disabled
- Added VS2017 shel extensions
- Fixed problem with propagating
CSScript.GlobalSettings.EnableDbgPrint
for hosted execution - Adding extra referenced namespaces when
CSScript.GlobalSettings.EnableDbgPrint == true
is made runtime version aware to avoid adding System.Linq for .NET 3.5. (System.Linq.dll exists only on .NET 4.0+)
- Added setting
Release v3.25.0.0
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).
- Added support for C# 7.
In order to activate it you need to adjust the default settings to use CS-Script code provider:
cscs -config:set:UseAlternativeCompiler:%CSSCRIPT_DIR%\lib\CSSCodeProvider.v4.6.dll
- Assorted defect fixed
- Added setting
LastCompilingResult
even when compiling script has failed. - Issue #47: Error while compiling related to environment block
- Added CSScript.IgnoreSystemWideConfig()
- Disabled "dbg.print" triggered injection of System.Linq/Core on Linux
- Disabled dbg.cs inclusion if dbg.print is disabled
- Fixed problem with propagating
CSScript.GlobalSettings.EnableDbgPrint
for hosted execution - Adding extra referenced namespaces when
CSScript.GlobalSettings.EnableDbgPrint == true
is made runtime version aware to avoid adding System.Linq for .NET 3.5. (System.Linq.dll exists only on .NET 4.0+)
- Added setting
Release v3.24.2.0
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).
- Issue #47: Error while compiling related to environment block
- Added CSScript.EnableScriptLocationReflection
- Added CSScript.IgnoreSystemWideConfig()
- Disabled "dbg.print" triggered injection of System.Linq/Core on Linux
- Disabled dbg.cs inclusion if dbg.print is disabled
- Adding extra referenced namespaces when
CSScript.GlobalSettings.EnableDbgPrint == true
is made 'runtime version aware' to avoid adding System.Linq for .NET 3.5. (System.Linq.dll exists only on .NET 4.0+) - Fixed problem with propagating
CSScript.GlobalSettings.EnableDbgPrint
for hosted execution
Release v3.24.0
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).
- Issue #45: Deprecation in wsdl.cs
-
Fixed setting
EntryScript
env variable. Previously it was set after execution of 'pre-scripts'. -
Updated wsdl.cs to reflect use
EntryScript
anv variable.static string ResolveOutputLocation(string file) { string primaryScriptFile = Environment.GetEnvironmentVariable("EntryScript"); ... }
-
- Issue #44: Neither AsmHelper nor Compiling provides the additional directories specified by //css_searchdir
-
Added
CompilingInfo.ParsingContext
that contains all parsing result data without resorting to store the whole parser. -
Added
CSScript.LastCompilingResult
, which is always set to the CompilingInfo of the last operation as opposite to theCSScript.CompilingHistory
log that is kept only if enabled. -
Added SimpleAsmProbing for simple assembly probing within specified dirs. Supports
using
statement declaration.var script = CSScript.Load("printer.cs"); var search_dirs = CSScript.LastCompilingResult.ParsingContext.SearchDirs; using (SimpleAsmProbing.For(search_dirs)) { dynamic printer = script.CreateObject("Printer"); printer.Print("Hello World!"); }
-
- All sample/lib scripts are now under source control: https://github.com/oleg-shilo/cs-script/tree/master/Source/deployment
- Added
-preload
command for preloading "heavy" compilers (e.g. Roslyn) - Further AutoclassGenerator improvements (IDE integration related)
- Further removal of net1 conditional compilations
Release v3.23.0
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).
- Added auto-referencing System.Linq.dll+System.Core.dll if dbg.cs is injected
- Added Settings.EnableDbgPrint to control inclusion of dbg.cs for Python-like
print(...)
methods - Added
-config:<raw|xml>
for printing raw/xml config file - Replaced embedding
dbg.cs
into resources with embedded string constant. To avoid explicit v4.5 dependency. - Added test for multiple entry points in the script
- Non-functional changes:
- Added reporting proper error on failure to invoke CLI
-config:set
- Added pre-build step for preparing dbg.res.cs
- Fixed problem with AutoclassGenerator incorrectly handling caret at the end of line
- Added reporting proper error on failure to invoke CLI
Release v3.22.0
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).
This release is a continuation of the effort for improving Linux/Mono integration. Thus new CLI argument config
has been added to better support non-UI configuration use-cases:
cscs -config ?
-config[:<option>]
Performs various CS-Script config operations
-config:none - ignores config file (uses default settings)
-config:create - creates config file with default settings
-config:default - prints default config file
-config - prints current config file content
-config:ls - lists/prints current config values
-config:get:name - prints current config value
-config:set:name=value - sets current config value
-config:<file> - uses custom config file
(e.g. cscscript -config:none sample.cs
cscscript -config:default > css_VB.xml
cscscript -config:set:inmem=true
cscscript -config:c:\cs-script\css_VB.xml sample.vb)
Another change is an additional support for reverse order of CLI help request for specific commands. Thus help for CLI argument cache
can be requested with any of the following commands:
-help cache
-? cache
-cache help
-cache ?
On Windows, Roslyn binaries are moved to the shadow directory to not interfere with upgrades via Chocolatey because of the running Roslyn binaries. To be fair Chocolatey is capable of handling this problem by long retries and other trickery, but it all affects user experience so CS-Script now loads Roslyn from the non-Choco location.
All changes
- Added dbg.print injection to the csws.exe to match it with cscs.exe.
- Issue #39: Suggestion for minor improvement in AsmHelper.Invoke()
- Issue #40: Suggestion for minor improvement in ScriptParser..ctor()
- Added
CompilerParameters
to the CSScript.CompilingHistory collection. Related to issue #26 - Added -config switch for CLI
- Implemented support for reversed order of parameters for the command specific help.
- Fully prepared for integration with N++ (and other editors)
- Added creating shadow copy of Roslyn services during first config to avoid dir locking because of running Roslyn binaries
Release v3.21.1
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.
- Added params concatenation:
- Issue#32: Inconsistent time stamp (.dll -vs- .pdb) when using
CSScript.CompileFile()
with 'debugBuild = true' - Added support for output file in //css_res.
- Implemented suppressing 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.21.0
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.
- Added params concatenation:
- 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).