1- C# Script execution engine (.NET Core). Version 4.11.5 .0.
1+ C# Script execution engine (.NET Core). Version 4.12.0 .0.
22Copyright (C) 2004-2023 Oleg Shilo.
33
44Usage: cscs <switch 1> <switch 2> <file> [params] [//x]
@@ -78,6 +78,8 @@ params Specifies optional parameters for a script file to be run.
7878 executable for integrating it with CS-Script by using -vs:init option.
7979 Alternatively, you can even ask to integrate the first detected executable with:
8080 cscs -vs:init 0
81+ -vs:init 0 is also an instruction of selecting the latest version of detected Visual Studio executable since the
82+ list is of available versions is ordered by the latest version first.
8183
8284-vscode
8385 Generates .NET project file and opens it in Visual Studio Code.
@@ -102,12 +104,13 @@ params Specifies optional parameters for a script file to be run.
102104-ng|-engine:<csc|dotnet|roslyn>
103105 Forces compilation to be done by one of the supported .NET engines.
104106
105- dotnet - dotnet.exe compiler; this is the most versatile compilation engine though it does have a startup
106- overhead when running the script for the first time. It requires .NET SDK to be installed on the target
107- system.
107+ dotnet - dotnet.exe compiler
108+ This is the most versatile compilation engine though it does have a startup overhead when running the script for
109+ the first time. It requires .NET SDK to be installed on the target system.
108110
109- csc - csc.exe compiler; the fastest compiler available. It is not suitable for WPF scripts as csc.exe cannot
110- compile XAML. It requires .NET SDK to be installed on the target system.
111+ csc - csc.exe compiler; the fastest compiler available.
112+ Though it is not suitable for WPF scripts as csc.exe cannot compile XAML.
113+ It also requires .NET SDK to be installed on the target system.
111114 This value is just a shorter form of the full equivalent csc-inproc.
112115 Legacy:
113116 Value csc-outproc triggers the compilation in the separate child process build.exe which is somewhat
@@ -118,8 +121,10 @@ params Specifies optional parameters for a script file to be run.
118121 family distributions. And it's only retained for the compatibility reasons. Starting from v4.10.0 the
119122 use of csc-outproc offers no benefits.
120123
121- roslyn - Microsoft.CodeAnalysis.CSharp.Scripting.dll compiler; this is the most portable compilation engine. It
122- does not require .NET SDK being installed. Though it does have limitations (see documentation).
124+ roslyn - Microsoft.CodeAnalysis.CSharp.Scripting.dll compiler
125+ This is the most portable compilation engine. It does not require .NET SDK being installed.
126+ Though it does have limitations. The script must have static Main(), you cannot have nested namespaces etc. (see
127+ documentation).
123128 The compilation is performed in the separate child process cscs (another instance of script engine)
124129 which is somewhat equivalent of VBCSCompiler.exe (build server) from .NET toolset.
125130 CS-Script communicates with cscs build server via socket (default port 17002). You can control port
@@ -403,7 +408,7 @@ params Specifies optional parameters for a script file to be run.
403408
404409-nuget[:restore]
405410 Installs new or updates existing NuGet packages. It is a very close equivalent of dotnet restore command
406- Note, using nuget directives in the script text aoffers more flexibility (e.g. version support. See cscs -syntax
411+ Note, using nuget directives in the script text offers more flexibility (e.g. version support. See cscs -syntax
407412 //css_nuget
408413
409414 -nuget - prints the list of all root packages in the repository
@@ -461,8 +466,6 @@ Engine directives:
461466- //css_include <file>;
462467- //css_import <file>[, preserve_main][, rename_namespace(<oldName>, <newName>)];
463468- //css_nuget [-force] [-ver:<version>] [-pre|--prerelease] package0[,package1]..[,packageN];
464- - //css_nuget [-noref] [-force[:delay]] [-ver:<version>] [-rt:<runtime>] [-ng:<nuget arguments>]
465- package0[,package1]..[,packageN];
466469- //css_args arg0[,arg1]..[,argN];
467470- //css_reference <file>;
468471- //css_precompiler <file 1>,<file 2>;
@@ -549,6 +552,8 @@ newName - new name of a namespace to be renamed during importing
549552------------------------------------
550553
551554//css_nuget [-force] [-ver:<version>] [-pre|--prerelease] package0[,package1]..[,packageN];
555+ Note: .NET 10 file-based execution directive '#:package' is also supported by internally converting it to the
556+ //css_nuget equivalent.
552557
553558Downloads/Installs the NuGet package. It also automatically references the downloaded package assemblies.
554559By default, the package is not downloaded again if it was already downloaded.
@@ -574,7 +579,7 @@ Note: Legacy NuGet support is less reliable, predictable or flexible (e.g. does
574579thus it's highly recommend that you use this mode only if you have to.
575580
576581The legacy NuGet support CLI is somewhat different:
577- //css_nuget [-noref] [-force[:delay]] [-ver:<version>] [-rt:<runtime>] [-ng:<nuget arguments>]
582+ (Legacy) - //css_nuget [-noref] [-force[:delay]] [-ver:<version>] [-rt:<runtime>] [-ng:<nuget arguments>]
578583package0[,package1]..[,packageN];
579584
580585If no version is specified then the highest downloaded version (if any) will be used.
@@ -623,9 +628,10 @@ Note: the arguments must be coma separated.
623628Alias - //css_ref
624629
625630file - name of the assembly file to be loaded at run-time.
631+ Note: .NET 10 file-based execution directive '#r' is also supported the same way as //css_reference.
626632This directive is used to reference assemblies required at run time.
627- The assembly must be in GAC , the same folder with the script file or in the 'Script Library' folders (see 'CS-Script
628- settings').
633+ The assembly must be in one of the search directories (in config file) , the same folder with the script file or in the
634+ 'Script Library' folders (see 'CS-Script settings').
629635
630636Note if you use wildcard in the referenced assembly name (e.g. socket.*.dll) the directive will only reference from
631637the first probing directory where the matching file(s) is found. Be careful with the wide wildcard as '*.dll' as they
0 commit comments