[mono-vb] Using reflection to invoke a method written in VB throws an exception
Rolf Bjarne Kvinge
rolflists at ya.com
Fri Jun 4 17:03:04 EDT 2010
I can have a look next week, I'll keep you posted.
Thanks for the test case
> -----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: viernes, 04 de junio de 2010 15:51
> Para: mono-vb at lists.ximian.com
> Asunto: Re: [mono-vb] Using reflection to invoke a method written in VB
> throws an exception
> 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.
> >First a little background, I am currently adding MonoDevelop support
> an >open-source project called SpecFlow. 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
> to Cucumber for >Ruby.
> >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.
> >MonoDevelop is using the vbnc compiler that I built from svn. Mono
> >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.
> only >difference between the two methods, is that the method that
> the >exception is decorated with an attribute called When. The other
> method is >decorated with an attribute called Then. Of course When is
> keyword in >VB, therefore we surround it with [ ]. While invoking,
> MonoMethod throws a >System.InvalidProgramException: Invalid IL code
> >ExternalStepsVB.VBStepDefinitions:step2 (): IL_000f: ret at line 223
> during >the call to InternalInvoke which is a pinvoke to a native
> 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
> >get feedback before submitting a bug report. You can grab my
> >from github and test the ExternalSteps test yourself with MonoDevelop
> using >the NUnitTestRunner to throw the exception that I am seeing.
> me know >if you need anything else.
> >: http://www.specflow.org/
> >: http://cukes.info/
> >: http://github.com/sinesignal/SpecFlow
> > Sorry, I just want to clarify a small typo in my message in this
> > The other method is decorated with an attribute called Then.
> > It should read: The other method is decorated with an attribute
> > Given.
> > --
> > View this message in context:
> > http://mono.1490590.n4.nabble.com/Using-reflection-to-invoke-a-
> > 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
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
More information about the Mono-vb