A robust, multi-threaded Windows Service built in C# designed to monitor a specific source directory, automatically detect newly added files, handle file-locking scenarios, and safely move/rename them using unique GUIDs to a destination directory with comprehensive logging.
##🚀 Features
- Real-time Monitoring: Utilizes FileSystemWatcher to instantly detect new file creations.
- File-Locking Prevention: Built-in retry mechanism to safely wait until source processes finish writing files before moving them.
- Unique Renaming: Automatically renames incoming files using GUIDs to prevent naming collisions.
- Dual Operation Mode: Runs as a standard Windows Service in production or interactively via Console mode for testing.
- Smart Filtering: Automatically filters out temporary files and system noise.
- Detailed Logging: Maintains persistent logs for all events, successes, and errors.
- Language: C#
- Architecture: Windows Service & Background Processing
- Key Namespaces: System.IO, System.ServiceProcess, System.Configuration
Configure your target directories in the App.config file:
-
Clone the repository: git clone https://github.com/Amer-css/FileMonitoringService.git
-
Open the solution in Visual Studio.
-
Build the project and run it in Console mode for testing, or install it as a Windows Service using InstallUtil.
Amer (@Amer-css)