[mono-vb] Using reflection to invoke a method written in VB throws an exception
Dale Ragan
dale.ragan at sinesignal.com
Fri Jun 4 09:51:15 EDT 2010
Any info on this? I am not sure how the Microsoft Sync Framework
discussion got started on this thread, but please see the first item in
this thread. I pasted it below for convenience also.
Dale
>
>First a little background, I am currently adding MonoDevelop support to
an >open-source project called SpecFlow[1]. Just a quick intro to
SpecFlow, it >allows us to create behavior driven specification tests
based off a common >user story syntax called Gherkin. It is very similar
to Cucumber[2] for >Ruby.
>Now for the problem, we have a test case to run external steps from other
>assemblies and one of the assemblies is a VB compiled assembly.
>MonoDevelop is using the vbnc compiler that I built from svn. Mono and
>MonoDevelop are built from svn also. These step methods are invoked
using >reflection. I have one class and two methods in this VB project
and the >first one executes 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 an attribute called When. The other
method is >decorated with an attribute called Then. Of course When is a
keyword in >VB, therefore we surround it with [ ]. While invoking,
MonoMethod throws a >System.InvalidProgramException: Invalid IL code in
>ExternalStepsVB.VBStepDefinitions:step2 (): IL_000f: ret at line 223
during >the call to InternalInvoke which is a pinvoke to a native method.
When I >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[3]
>from github and test the ExternalSteps test yourself with MonoDevelop
using >the NUnitTestRunner to throw the exception that I am seeing. Let
me know >if you need anything else.
>Thanks,
>Dale
>[1]: http://www.specflow.org/
>[2]: http://cukes.info/
>[3]: http://github.com/sinesignal/SpecFlow
>
> Sorry, I just want to clarify a small typo in my message in this sentence:
> The other method is decorated with an attribute called Then.
>
> It should read: The other method is decorated with an attribute called
> Given.
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Using-reflection-to-invoke-a-method-written-in-VB-throws-an-exception-tp2236684p2236687.html
> Sent from the Mono - VB mailing list archive at Nabble.com.
> _______________________________________________
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb
>
More information about the Mono-vb
mailing list