In general, if code runs under .NET, and the code uses types implemented
in Mono, the code should run under Mono [0].

Consequently, if a test passes under .NET and fails under Mono, chances
are very high that it's a Mono bug.

Consequently, what needs to be done is create minimal test cases for
these bugs which work under .NET and fail under Mono, and them to Mono's
bugzilla at:

    https://bugzilla.novell.com/index.cgi

For your code below, "minimal" would mean "without references to
[WebMethod]."

I would appreciate any effort in creating minimal test cases and filing
bugs regarding these.  I know that there are at least 5 tests in
DbLinq.Sqlite_test_mono.dll that pass under .NET and fail under Mono, so
I suspect that all of those are Mono bugs.

 - Jon

[0] Exceptions include areas that are governed by a standard, and Mono
and .NET have different interpretations of the standard.  The classic
examples are XML and the C# compiler.  In this case, there's likely no
"third party standard interpretation" to fallback on.

On Thu, 2009-06-18 at 22:19 +0300, Andrus Moor wrote:
> When todays SVN code is used from Mono 2.4 web service in Linux,
> InvalidCastException
> occurs after number of some DynamicInvoke() calls.
>  
> For multiple tests, attempt number (24) where exception occurs
> changes.
> Exception occurs in DbLinq at line which calls DynamicInvoke().
>  
> Maybe Dblinq changes delegates in a way which causes exceptions in
> Mono.
>  
> Any idea how to fix or debug this ?
> From Visual Studio test is running OK.
>  
> Andrus.
>  
> Test code:
>  
> using System;
> using System.Linq;
> using System.Threading;
> using System.Web.Services;
>  
> namespace Test.Service
> {
>  
> [WebService]
> public sealed class StockService : WebService
>  {
>   class TestEntity
>   {
>    public int contents { get; set; }
>   }
>  
> [WebMethod]
> public string Test()
>   {
>    int i = 0;
>    try
>    {
>     for (; i < 950; i++)
>     {
>      using (var db = new Northwind(new Npgsql.NpgsqlConnection(
>  
> "host=localhost;DATABASE=Northwind;USER=LinqUser;PASSWORD=linq2;SSLMODE=Prefer;SSL=True"),
>  new DbLinq.PostgreSql.PgsqlVendor()))  
>  
>      db.ExecuteQuery<TestEntity>("SELECT 1 as contents").ToList();
>  }
>  }
>  catch (Exception ex)  {  
>     return "Exception at attempt " + i.ToString() + ": " +
> ex.ToString();  
>     } 
>  return i.ToString() + "iterations passed";  
>   }
>   }
> }
>  
> Result:
>   
> Exception at attempt 24: System.InvalidCastException: Cannot cast
> fromsource type to destinationtype.
>  
> at System.Delegate.get_Method ()[0x00027]
> in /root/src/mcs/class/corlib/System/Delegate.cs:107
>  
> at System.Delegate.DynamicInvokeImpl (System.Object[]
> args)[0x00000]in/root/src/mcs/class/corlib/System/Delegate.cs:420
>  
> 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.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[Test.Service.StockService
> +TestEntity].MoveNext ()[0x00000]
>  
> at System.Collections.Generic.List`1[Test.Service.StockService
> +TestEntity].AddEnumerable (IEnumerable`1 enumerable)[0x00000]
>  
> at System.Collections.Generic.List`1[Test.Service.StockService
> +TestEntity]..ctor (IEnumerable`1 collection)
> [0x00000]atSystem.Linq.Enumerable.ToList[TestEntity] (IEnumerable`1
> source)[0x00000]
>  
> at Test.Service.StockService.Test () [0x00000]
> 
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to