[Mono-list] DynamicInvoke calls causes exceptions

Andrus Moor kobruleht2 at hot.ee
Tue Jun 16 08:24:01 EDT 2009


I tried to run VS web service in  Debian + Mono 2.4 + mod_mono
This web service uses DbLinq which makes a lot of
System.Delegate.DynamicInvoke() calls to convert npgsql
DataReader results to property values.

DynamicInvoke() calls cause randomly TargetParameterCountException or in
fewer cases InvalidCastException. Stack traces are below.

10 subsequent web service calls with same parameters will all never succeed. 
TargetParameterCountException is reproducible my making at most 10 calls.

How to debug of fix this ?

Andrus.

System.Reflection.TargetParameterCountException: parameters do not match
signature
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x000fc] in
/root/src/mcs/class/corlib/System.Reflection/MonoMethod.cs:185
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[]
parameters) [0x00000] in
/root/src/mcs/class/corlib/System.Reflection/MethodBase.cs:111
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000ab] in
/root/src/mcs/class/corlib/System/Delegate.cs:439
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args)
[0x00018] in /root/src/mcs/class/corlib/System/MulticastDelegate.cs:71
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in
/root/src/mcs/class/corlib/System/Delegate.cs:415
  at DbLinq.Data.Linq.Sugar.Expressions.InputParameterExpression.GetValue ()
[0x00002] in
I:\raamat\MyApp\dblinq\DbLinq\Data\Linq\Sugar\Expressions\InputParameterExpression.cs:58


In fewer cases InvalidCastException occurs:

System.InvalidCastException: Cannot cast from source type to destination
type.
  at System.Delegate.get_Method () [0x00000]
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000]
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args)
[0x00000]
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000]
  at
DbLinq.Data.Linq.Sugar.Implementation.QueryRunner+<EnumerateResult>d__b.MoveNext
() [0x00000]
  at
DbLinq.Data.Linq.Sugar.Implementation.QueryRunner+<ExecuteSelect>d__0.MoveNext
() [0x00000]
  at
DbLinq.Data.Linq.DataContext+<CreateExecuteQueryEnumerable>d__d`1[Business.Datadict].MoveNext
() [0x00000]
  at System.Collections.Generic.List`1[Business.Datadict].AddEnumerable
(IEnumerable`1 enumerable) [0x00000]
  at System.Collections.Generic.List`1[Business.Datadict]..ctor
(IEnumerable`1 collection) [0x00000]
  at System.Linq.Enumerable.ToList[Datadict] (IEnumerable`1 source)
[0x00000]
  at Business.Database.ExecQuery[Datadict] (System.String command,
System.Type[] src, System.Object[] prm) [0x00000]
  at Business.Database.ExecQuery[Datadict,Datadict] (System.String command,
System.Object[] prm) [0x00000]
  at Business.EntityFactory.GetSpecialPropertyScript (System.String
entityName) [0x00000]
  at Business.EntityFactory.GetCustomEntityType (System.String entityName)
[0x00000]
  at Business.EntityFactory.Get (System.String entityName) [0x00000]
  at Business.EntityFactory.Create (System.String entityName) [0x00000]
  at Service.StockService.AddNewKuulutus (Service.UserCredentials& header,
System.String headerEntity, Business.FormField[] headerFields,
Business.RidT[] rowFields) [0x00000] 



More information about the Mono-list mailing list