Build a procedure for the C# application to call