To give you information on how to find this error - what does this error give on information?
Error 1 No overload for 'OnRenamed' matches delegate 'System.IO.FileSystemEventHandler'
This means that the parameters and return types of the OnRenamed method do not match the parameters and return types defined by the FileSystemEventHandler.
The method OnRenamed is defined with a void return type and object, RenamedEventArgs parameters. The FileSystemEventHandler delegate is defined this way:
Code:
public delegate void FileSystemEventHandler(object sender, FileSystemEventArgs e);
So the second parameter of OnRenamed could be changed to FileSystemEventArgs instead of RenamedEventArgs.
However, checking further where the method OnRenamed is applied to, it should be with the Renamed event of the FileSystemWatcher. This event is of type RenamedEventHandler. The RenamedEventHandler delegate matches the parameters you've defined with the OnRenamed method. So you probably assigned the OnRenamed method to a different event that is of type FileSystemEventHandler, e.g. Deleted, Changed, or Created.