To get return Value from method invocation using reflection in C# and VB.NET you can use the snippet below.
Sample C#
var returnValue = (Int32)methodInfo.Invoke(null,null); //just cast the returned object of Invoke to the needed Type. Theres no difference if it is a static method/class or not
Sample VB.NET
Dim returnValue = DirectCast(methodInfo.Invoke(Nothing, Nothing), Int32) 'just cast the returned object of Invoke to the needed Type. Theres no difference if it is a static method/class or not
For more informations on how to invoke methods from other assemblies using reflection see:
RT @CodeSnippetsNET: How to get return value from method invocation using reflection in C# and #VB .NET http://t.co/XVt0XBbBEo #visualbasic…
RT @CodeSnippetsNET: How to get return value from method invocation using reflection in C# and #VB .NET http://t.co/XVt0XBbBEo #visualbasic…
RT @CodeSnippetsNET: How to get return value from method invocation using reflection in C# and #VB .NET http://t.co/XVt0XBbBEo #visualbasic…