ScriptStash.Net 2.0.0

.NET 5.0 .NET Core 3.0 .NET Standard 2.0 .NET Framework 4.7.2
dotnet add package ScriptStash.Net --version 2.0.0
NuGet\Install-Package ScriptStash.Net -Version 2.0.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="ScriptStash.Net" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ScriptStash.Net --version 2.0.0
#r "nuget: ScriptStash.Net, 2.0.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 ScriptStash.Net as a Cake Addin
#addin nuget:?package=ScriptStash.Net&version=2.0.0

// Install ScriptStash.Net as a Cake Tool
#tool nuget:?package=ScriptStash.Net&version=2.0.0


What is ...

ScriptStash is a C# code loader for text/script files manipulation. It loads each script file once. Keeping it stored in-memory, ready to be used for any applicative reuse over and over. Also, it can be used for token-driven scripting (e.g. place in script token for SELECT-SQL table name, changing the query target table dynamically at run-time).

How it works ...

ScriptStash loads with System.IO.File each script at its destination folder and store it in-memory while your solution application running. ScriptStash can store dictionary key-value pairs for token injection to every stored tokenized script file. So, it can return the original file loaded, or a transformed text with all needed tokens replaced with values from given dictionary.

Usage ...

Usage examples:

  • Maintain a query SQL scripts directory for a web-application with database storage.
  • Keep reusable shell scripts for 3rd party ALM tool. Load and execute them from yours C# application utility.
  • Store scripts from any scripting language (e.g. PowerShell, VBScript, JavaScript, etc.) for execution from C# app.
  • Handle installation scripts batch, to be deployed on several environments with different inner setting per environment.
  • Maintain test template scripts, with data-driven cases to be injected to each test template before execution.

Code Example ...

  string scriptsFolder = "c:\project\scripts";
  string pattern = "*.sql";
  string genSelectAllQuery = "select_all_query.sql";
  string genTemplateTableQuery = "template_table_query.sql";
  ScriptStash mySqlStash = new ScriptStash(scriptsFolder, pattern);
  string sqlText1 = myStash[genSelectAllQueryName].Text;
  myStash.Tokens["<table-name>"] = "USERS";
  myStash.Tokens["<where-clause>"] = "WHERE USER.City='Tel-Aviv";
  string sqlText2 = myStash[genTemplateTableQuery].InjectTokens();

[!] For more indepth example please chek next Gist : Stash example - SQL queries


Check out ScriptStash documentation pages here.


This project is MIT licensed. For more information, see license.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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-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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 is compatible.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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)
Additional computed target framework(s)
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
2.0.0 489 11/13/2021
1.0.1 882 11/11/2018
1.0.0 1,173 11/10/2018

Major release with 1st time dotnet multi frameworks support.