winget install --id=francWhite.watchex -e
Watch and update non-compiled files of a .csproj project at runtime
Watchex is a tool designed to automatically evaluate and update non-compiled files of a .csproj project at runtime. It monitors files marked with CopyToOutputDirectory attributes ("Always" or "PreserveNewest") and ensures they are copied to the output directory whenever changes occur, eliminating the need for manual rebuilds after updates to content files like translations or configurations.
Key Features:
Audience & Benefit:
Ideal for developers working on complex .NET applications where content files are stored in dependencies or require frequent updates without rebuilds. Watchex streamlines the development process by automatically managing file updates, saving time and reducing manual effort.
Watchex can be installed via winget using the command winget install francWhite.watchex
.
Evaluates all files in a given .csproj file, including its dependencies, which are marked as CopyToOutputDirectory "Always" or "PreserveNewest" and thus would be copied to the output directory during the build process. These files are then observed and if any changes are detected, they are copied to the output directory. This avoids having to rebuild the project after changes in content files like translations or non standard configurations.
Why not just use dotnet watch? Even though dotnet watch
is a great tool, it has its limitations. If you have some non-compiled files in a dependency which are included with a wildcard like translations\**\*.json
, dotnet watch will not detect changes in these files because their paths are evaluated incorrectly; it will look for them in the startup project directory instead of the dependency in question.
winget install francWhite.watchex
Download the latest release from the releases page, extract the archive to a folder of your choice and add said folder to your PATH environment variable.
USAGE:
watchex [OPTIONS]
OPTIONS:
-h, --help Prints help information
-v, --verbose Prints verbose log output
-V, --version Prints version information
-p, --project Path to the project file. Defaults to the first *.csproj file found in the current directory
Distributed under the MIT license