static void Main(string[] args) { using (var test = new dll()) { string str = "invoke1"; var result = test.invoke1(ref str, 1); Console.WriteLine($"invoke1 result: {result}"); str = "invoke2"; test.invoke2(ref str); test.invoke3(); str = "invoke4"; test.invoke4(ref str); str = "invoke5"; test.invoke5(ref str); } }