Fixing hook execution for csharp