[mono-vb] Using reflection to invoke a method written in VB throws an exception
Rolf Bjarne Kvinge
rolflists at ya.com
Thu Jun 10 05:24:56 EDT 2010
This has been fixed now in trunk (r158782).
> -----Mensaje original-----
> De: mono-vb-bounces at lists.ximian.com [mailto:mono-vb-
> bounces at lists.ximian.com] En nombre de Dale Ragan
> Enviado el: lunes, 31 de mayo de 2010 0:32
> Para: mono-vb at lists.ximian.com
> Asunto: [mono-vb] Using reflection to invoke a method written in VB
> throws an exception
> First a little background, I am currently adding MonoDevelop support to
> open-source project called SpecFlow. Just a quick intro to
> SpecFlow, it
> allows us to create behavior driven specification tests based off a
> user story syntax called Gherkin. It is very similar to Cucumber
> Now for the problem, we have a test case to run external steps from
> assemblies and one of the assemblies is a VB compiled assembly.
> is using the vbnc compiler that I built from svn. Mono and MonoDevelop
> built from svn also. These step methods are invoked using reflection.
> have one class and two methods in this VB project and the first one
> correctly, but the second one does not. The only difference between
> the two
> methods, is that the method that throws the exception is decorated with
> attribute called When. The other method is decorated with an attribute
> called Then. Of course When is a keyword in VB, therefore we surround
> with [ ]. While invoking, MonoMethod throws a
> System.InvalidProgramException: Invalid IL code in
> ExternalStepsVB.VBStepDefinitions:step2 (): IL_000f: ret at line 223
> the call to InternalInvoke which is a pinvoke to a native method. When
> translate the method using C# the test passes, so there shouldn't be
> anything wrong with the code.
> I decided to post here, since it is complaining about the IL and also
> to get
> feedback before submitting a bug report. You can grab my source
> github and test the ExternalSteps test yourself with MonoDevelop using
> NUnitTestRunner to throw the exception that I am seeing. Let me know
> if you
> need anything else.
> : http://www.specflow.org/
> : http://cukes.info/
> : http://github.com/sinesignal/SpecFlow
> View this message in context: http://mono.1490590.n4.nabble.com/Using-
> Sent from the Mono - VB mailing list archive at Nabble.com.
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
More information about the Mono-vb