WhatExec.Lib 1.2.0

dotnet add package WhatExec.Lib --version 1.2.0
                    
NuGet\Install-Package WhatExec.Lib -Version 1.2.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="WhatExec.Lib" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WhatExec.Lib" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="WhatExec.Lib" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WhatExec.Lib --version 1.2.0
                    
#r "nuget: WhatExec.Lib, 1.2.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.
#:package WhatExec.Lib@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WhatExec.Lib&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=WhatExec.Lib&version=1.2.0
                    
Install as a Cake Tool

WhatExec.Lib

Description

WhatExec.Lib is a C# library that finds executable files in PATH Environment Variables, Directories or Drives.

WhatExec.Lib implements WhatExec.Lib.Abstractions's interfaces.

Locators

Scenario Interface Class
Finding all Executable files on a Drive or in a Directory IExecutablesLocator ExecutablesLocator
Finding all Executable files with the same name IExecutableFileInstancesLocator ExecutableFileInstancesLocator

Resolvers

Scenario Interface Class
Resolve the file paths of specified Executable files IExecutableFileResolver ExecutableFileResolver
Resolve an Executable file path using just the PATH Environment variable IPathEnvironmentVariableResolver PathEnvironmentVariableResolver

Detectors

Scenario Interface Class
Detects whether a file is executable or not. IExecutableFileDetector ExecutableFileDetector
Detects the contents of the PATH Environment Variable, and the Path Executable Extensions Variable.<sup>1</sup> IPathEnvironmentVariableDetector PathEnvironmentVariableDetector

<sup>1</sup> - Executable extensions returns empty array on non-Windows platforms.

Installation

To install WhatExecLib, run the following command

dotnet add package WhatExec.Lib

License

This library is licensed under the terms of the Mozilla Public License 2.0.

Product 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 is compatible.  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 is compatible.  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 is compatible.  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 net461 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on WhatExec.Lib:

Package Downloads
WhatExec.Lib.Extensions.DependencyInjection

Registers WhatExecLib with Microsoft.Extensions.DependencyInjection

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 129 9/19/2026
1.1.0 233 6/8/2026
1.0.0 384 3/13/2026

## Changes since 1.1.0

### Added
- Added `IExecutableInstancesLocator` with streaming `DirectoryInfo`, `DriveInfo`, and `SearchOption` overloads on top of `System.IO.Abstractions` `IFileSystem`.
- Added streaming `EnumerateExecutableFilePathsAsync` and a `TryGet` collector on `PathEnvironmentVariableResolver`. Both support single-name overloads with first-match semantics.
- Added `ExecutablesLocatorTests`, `ExecutableInstancesLocatorTests`, and `PathEnvironmentVariableResolverUnitTests`. They cover directory, drive, and across-drives lookup, executable filtering, skipped inaccessible entries, `SearchOption` behavior, cancellation, and casing. Tests run against the testing-helper fake filesystem.
- Added `System.IO.Abstractions 22.2.0` and `System.IO.Abstractions.TestingHelpers 22.2.0`.
- Added decision record for the discovery path and implementation tickets 001 to 004 covering contract consolidation, split-pair locators, PATH redesign, and CLI migration.

### Changed
- Moved six contract interfaces from `WhatExec.Lib.Abstractions` into `WhatExec.Lib` under `WhatExec.Lib.*` namespaces. Updated consumers in Lib, Cli, Cli.Lite, Extensions.DependencyInjection, and Tests.
- Rewrote `PathEnvironmentVariableResolver` around one internal `FindFirstPathMatchAsync` PATH walk. Batch lookups take a snapshot of names so repeat passes stay consistent.
- Renamed locator `Within*` methods to `In*`, such as `InDirectory`, `InDrive`, and `AcrossDrives`. Applied the rename in interfaces, implementations, CLI commands, and tests.
- Wired `FindCommand` to `IPathEnvironmentVariableResolver` plus `IExecutableInstancesLocator`, checking PATH first. Wired `FindAllCommand` to `IExecutableInstancesLocator`. Registered the new locator in DI.
- Migrated resolver test classes from NUnit assertions to TUnit syntax.
- Documented the Winget ACL traversal limit in `README.md` under Known issues and in the VsCode resolver test.
- Updated NuGet package metadata to `1.1.0` in Cli, Cli.Lite, Lib, and Extensions.DependencyInjection.
- **Runtime dependencies.** Updated `DotExtensions` 10.3.2 to 10.5.2, `DotMake.CommandLine` 3.5.0 to 3.7.0, `Microsoft.Extensions.DependencyInjection`, `Abstractions`, `Microsoft.Bcl.AsyncInterfaces`, `System.Linq.AsyncEnumerable` 10.0.8 to 10.0.12, `Spectre.Console` 0.56.0 to 0.57.2, `Polyfill` 10.8.1 to 11.3.0.
- **CI dependencies.** Updated `actions/checkout` 6.0.3 to 7.0.1, `actions/setup-dotnet` 5.3.0 to 6.0.0, `github/codeql-action/upload-sarif` 4.36.2 to 4.37.9, `step-security/harden-runner` 2.19.4 to 2.21.1, `ossf/scorecard-action` 2.4.3 to 2.4.4, `Meziantou.Analyzer` 3.0.101 to 3.0.262.
- **Testing dependencies.** Updated `TUnit` 1.44.39 to 1.68.17.

### Deprecated
- Marked `IExecutableFileResolver`, `ExecutableFileResolver`, and `IExecutableFileInstancesLocator` members `Obsolete`. They warn on use and removal waits one version.
- Kept legacy `Get*` and `Task[]` locator members and the `ExecutableFileLocated` event as `[Obsolete]` for migration. They sit outside the new locator contract.

### Removed
- Removed the `WhatExec.Lib.Abstractions` project from the solution and deleted its directory. Dropped its `ProjectReference` and central `PackageVersion` entry.
- Removed `IPathEnvironmentVariableDetector`, `PathEnvironmentVariableDetector`, and the `GetPathContents` and `GetPathExtensions` hooks. The resolver reads PATH data directly from the environment.
- Removed the `ExecutableFileLocated` event from the new `IExecutableInstancesLocator` and `PathEnvironmentVariableResolver`.
- Deleted empty CLI event handlers.

### Fixed
- Fixed a parallel-run race in `PathEnvironmentVariableResolverUnitTests`. Cases mutated process-wide `PATH` and `PATHEXT` and the windows overlapped, so lookups saw another case's values. Marked the environment-touching resolver test classes `[NotInParallel]`.

[1.2.0]: https://github.com/alastairlundy/whatexec/compare/1.1.0...HEAD