[mono-vb] Using reflection to invoke a method written in VB throws an exception

Rolf Bjarne Kvinge rolflists at ya.com
Fri Jun 11 19:38:05 EDT 2010


Hi,

> -----Mensaje original-----
> De: Dale Ragan [mailto:dale.ragan at sinesignal.com]
> Enviado el: viernes, 11 de junio de 2010 15:32
> Para: Rolf Bjarne Kvinge
> CC: mono-vb at lists.ximian.com
> Asunto: RE: [mono-vb] Using reflection to invoke a method written in VB
> throws an exception
> 
> Ahh, thanks for the explanation.  When is the next 2.6.x release
> planned that will include this patch?

Unfortunately this patch will not be backported to 2.6, vbnc recently went
through some major changes that can't be backported to maintenance releases
(the risk of breaking something else would be too great).

>  I guess a work around until a patch is
> released for users will be to write it out the long way:
> 
> var counter = ScenarioContext.Current.Item("counter")
> ScenarioContext.Current.Item("counter") = counter + 1

This will work (except that you're mixing C# and VB here, VB doesn't have
'var' :) )

Note that the bug was only for a few very specific code sequences (this
still worked for instance: ScenarioContext.Current("counter") += 1)
 
Rolf

> 
> > The problem was with the += operator, vbnc wasn't generating code for
> the
> > property getter, it was doing the calculations without getting the
> value
> > of
> > the left side of the statement first.
> >
> >> -----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, 11 de junio de 2010 3:57
> >> Para: mono-vb at lists.ximian.com
> >> Asunto: Re: [mono-vb] Using reflection to invoke a method written in
> VB
> >> throws an exception
> >>
> >>
> >> Works for me, thanks for the fix.  If you don't mind me asking, what
> >> was the
> >> problem?
> >> --
> >> View this message in context:
> http://mono.1490590.n4.nabble.com/Using-
> >> reflection-to-invoke-a-method-written-in-VB-throws-an-exception-
> >> tp2236684p2251211.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