Net4x.UtilityLibrary
1.5.1.26262
dotnet add package Net4x.UtilityLibrary --version 1.5.1.26262
NuGet\Install-Package Net4x.UtilityLibrary -Version 1.5.1.26262
<PackageReference Include="Net4x.UtilityLibrary" Version="1.5.1.26262" />
<PackageVersion Include="Net4x.UtilityLibrary" Version="1.5.1.26262" />
<PackageReference Include="Net4x.UtilityLibrary" />
paket add Net4x.UtilityLibrary --version 1.5.1.26262
#r "nuget: Net4x.UtilityLibrary, 1.5.1.26262"
#:package Net4x.UtilityLibrary@1.5.1.26262
#addin nuget:?package=Net4x.UtilityLibrary&version=1.5.1.26262
#tool nuget:?package=Net4x.UtilityLibrary&version=1.5.1.26262
Net4x.UtilityLibrary
General-purpose helpers for .NET Framework 3.5 → .NET Standard 2.0: file system, zip, processes, reflection, networking, XML/HTML and string utilities.
- Targets:
net35,net40,net45,net461,netstandard2.0 - Strong-named, SourceLink enabled
- Author: Piero Viano — Copyright (c) Piero Viano. All rights reserved.
dotnet add package Net4x.UtilityLibrary
Most services are exposed as SomeUtility.Instance (interface-typed singleton); the rest are extension methods in the UtilityLibrary namespace.
Features
| Area | Namespace | Entry points |
|---|---|---|
| File system | UtilityLibrary.FileSystem |
FilePatternMatcher (wildcard exclusions, longest common path), BackupUtility (.bak backup/restore), CopyUtility (copy preserving dates), DeleteUtility (deferred delete on Dispose), TemporaryFileUtility, PathExtender |
| Zip ¹ | UtilityLibrary.Zip |
ZipArchiver (directory/file list → zip file or stream), ZipArchive.ExtractToDirectory(dir, overwrite) |
| Processes | UtilityLibrary.Process |
ProcessUtility (run with timeout, capture stdout/stderr, resolve exe via PATH/%VAR%), BatchExecuter (run command sequences), Process.WaitForProcessExitAsync(), ProcessHelper.ProgramIsRunning |
| Reflection | UtilityLibrary.Reflection |
AssemblyResolver / AppDomain.HandleAssemblyLoad(), AssemblyLoader, ReferencesGetter, ReflectionHelper, ProductNameUtility; UtilityLibrary.CustomAttributes.AssemblyCustomAttributeGetter |
| Networking | UtilityLibrary.Networking |
PortTester / Uri.IsChannelOpen(), TcpUdp.IsPortAvailable, MimeHelper, FileUploader (FTP) |
| HTTP | UtilityLibrary.Http.DataLibrary.Utility.Http |
HttpUtility (HTML/URL encode, query-string key, remote HTTP/FTP file exists) |
| Certificates ² | UtilityLibrary.Certificates |
CertificateDownloader (download/register site certificate) |
| XML | UtilityLibrary.Xml |
XmlHelper (ensure child/grandchild elements, XPath selects) |
| HTML | UtilityLibrary.Html |
HtmlTableHelper, BootstrapHelper (DataTable → Bootstrap page), HtmlShowHelper |
| Serialization | UtilityLibrary.Serialization |
XML-serializable SerializableDictionary, SerializableList, SerializableTuple |
| Strings | UtilityLibrary, .StringManipulation, .RegEx |
ToPhrase, ReplaceCaseInsensitive, ParseItalianLongDate, StartsWithHttpOrHttps, SplitResolvingAcronims, StripComments |
| Expressions | UtilityLibrary |
GetPropertyPath(), GetMemberPath() (x => x.A.B → "a.b") |
| Misc | UtilityLibrary |
PublicInstancePropertiesEqual, DataTable.CsvToDataTable, StringBuilder tab helpers (AddTab/RemoveTab), Point.TranslatePoint |
¹ not on net35/net40 · ² net461 and netstandard2.0 only
Examples
using UtilityLibrary;
using UtilityLibrary.FileSystem;
using UtilityLibrary.Process;
using UtilityLibrary.Zip;
// Zip a folder, skipping build output
ZipArchiver.Instance.ZipFiles(@"C:\out\src.zip", @"C:\src", false, @"bin\*", @"obj\*");
// Filter a file list with wildcard path patterns
var kept = FilePatternMatcher.Instance.ExcludePattens(files, new[] { @"bin\debug\*.pdb" });
// Run a process, wait up to 10 s, read its output
var process = await ProcessUtility.Instance.RunProcess(workDir, "git", "status", 10000,
ignoreTimeOutError: false, stringToSearch: null, threadSleepBeforeProcessKill: 0,
logToStdErr: false, hideProcessWindow: true);
string? output = ProcessUtility.Instance.Tuple?.Output;
// Run several commands, stop at the first non-zero exit code
bool ok = await BatchExecuter.Instance.RunScriptsFromTuples(false, true,
new ProcessExecutionInfo(workDir, "dotnet", "restore"),
new ProcessExecutionInfo(workDir, "dotnet", "build"));
// Expressions and strings
string path = ((Expression<Func<Order, string>>)(o => o.Customer.Name)).GetPropertyPath(); // "customer.name"
string phrase = "Tbl_OrderLines".ToPhrase("Tbl_"); // "Order lines"
// Backup / restore a file (suffix from appSettings "OldSuffix", default ".bak")
BackupUtility.Instance.CreateBackupFile(@"C:\app\app.config", deleteSourceFile: false);
BackupUtility.Instance.RestoreBackupFile(@"C:\app\app.config");
Configuration keys (appSettings / command line)
| Key | Used by | Default |
|---|---|---|
OldSuffix |
BackupUtility |
.bak |
Plugins |
PluginManager — ext\|Type.FullName\|Assembly;… |
— |
WaitBeforeDelete |
HtmlShowHelper (seconds) |
10 |
ReplaceStarting / ReplaceEnding |
GetStringSplit (from,to pairs) |
— |
Dependencies
Net4x.BaseTypes, Net4x.Configuration.Library, Net4x.CoreLibrary.Files, Net4x.CoreLibrary.PassingProperties, Net4x.IoCLibrary; System.Management on netstandard2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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-browser 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. 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. |
-
.NETFramework 3.5
- Net4x.BaseTypes (>= 1.3.1.26251)
- Net4x.Configuration.Library (>= 2.5.0.26236)
- Net4x.CoreLibrary.Files (>= 2.5.0.26236)
- Net4x.CoreLibrary.PassingProperties (>= 2.5.0.26236)
- Net4x.IoCLibrary (>= 1.8.0.26250)
-
.NETFramework 4.0
- Net4x.BaseTypes (>= 1.3.1.26251)
- Net4x.Configuration.Library (>= 2.5.0.26236)
- Net4x.CoreLibrary.Files (>= 2.5.0.26236)
- Net4x.CoreLibrary.PassingProperties (>= 2.5.0.26236)
- Net4x.IoCLibrary (>= 1.8.0.26250)
-
.NETFramework 4.5
- Net4x.BaseTypes (>= 1.3.1.26251)
- Net4x.Configuration.Library (>= 2.5.0.26236)
- Net4x.CoreLibrary.Files (>= 2.5.0.26236)
- Net4x.CoreLibrary.PassingProperties (>= 2.5.0.26236)
- Net4x.IoCLibrary (>= 1.8.0.26250)
-
.NETFramework 4.6.1
- Net4x.BaseTypes (>= 1.3.1.26251)
- Net4x.Configuration.Library (>= 2.5.0.26236)
- Net4x.CoreLibrary.Files (>= 2.5.0.26236)
- Net4x.CoreLibrary.PassingProperties (>= 2.5.0.26236)
- Net4x.IoCLibrary (>= 1.8.0.26250)
- System.Security.Permissions (>= 9.0.0)
-
.NETStandard 2.0
- Net4x.BaseTypes (>= 1.3.1.26251)
- Net4x.Configuration.Library (>= 2.5.0.26236)
- Net4x.CoreLibrary.Files (>= 2.5.0.26236)
- Net4x.CoreLibrary.PassingProperties (>= 2.5.0.26236)
- Net4x.IoCLibrary (>= 1.8.0.26250)
- System.Management (>= 7.0.2)
NuGet packages (31)
Showing the top 5 NuGet packages that depend on Net4x.UtilityLibrary:
| Package | Downloads |
|---|---|
|
Net4x.DataAccessLibrary.Helpers
Package Description |
|
|
Net4x.DataAccessLibrary.Utility.Helpers
Package Description |
|
|
Net4x.Win32Library
Package Description |
|
|
Net4x.FormLogging.Library
Package Description |
|
|
Net4x.EntityFramework.Library
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.1.26262 | 0 | 9/20/2026 |
| 1.5.1.26236 | 2,309 | 8/24/2026 |
| 1.5.1.9 | 241 | 7/17/2026 |
| 1.5.1.8 | 306 | 2/2/2026 |
| 1.5.1.7 | 323 | 1/23/2026 |
| 1.5.1.6 | 350 | 1/5/2026 |
| 1.5.1.5 | 293 | 12/30/2025 |
| 1.5.1.4 | 506 | 11/13/2025 |
| 1.5.1.2 | 414 | 5/30/2025 |
| 1.5.1 | 456 | 5/16/2025 |
| 1.5.0 | 2,637 | 3/31/2025 |
| 1.1.0 | 6,393 | 8/26/2023 |
| 1.1.0-at20230505035427 | 5,881 | 5/8/2023 |