System.ApplicationException: Invalid IL code in System.Linq.Enumerable

100 views
Skip to first unread message

pikou pikou

unread,
Jan 25, 2015, 3:56:11 PM1/25/15
to npgsq...@googlegroups.com
Hello I am experiencing a very strange exception when I try to run through Xamarin Studio on mono 3.3.0. The exception is as follows

Unhandled Exception:
System.ApplicationException: Invalid IL code in System.Linq.Enumerable:Where<TSource> (System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource, bool>): method body is empty.


  at TestEF.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ApplicationException: Invalid IL code in System.Linq.Enumerable:Where<TSource> (System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource, bool>): method body is empty.


  at TestEF.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
The application exited with code: 1


The project runs fine when I target .net framework as the run target platform , goes on to connect to my local postgresql instance , initialize the DBContext and loop through a small table and print the results.

Emil Lenngren

unread,
Jan 25, 2015, 3:59:30 PM1/25/15
to pikou pikou, npgsq...@googlegroups.com
It's probably a mono bug and not an Npgsql bug. Could you post how your Main function looks like?

--
You received this message because you are subscribed to the Google Groups "Npgsql Help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to npgsql-help...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/npgsql-help/469363a2-651f-450e-91a8-0772e6e15529%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pikou pikou

unread,
Jan 25, 2015, 4:20:46 PM1/25/15
to npgsq...@googlegroups.com
Hello and thanks for your reply , here is the Main method

static
 void Main(string[] args)
        {
            try 
            {
                var lal = new GAPICCTIEntities ();

                foreach (var l in lal.appuser.ToList())
                {
                    Console.WriteLine(l.username);
                }
                Console.ReadKey();
                
            } catch (Exception ex) {
                throw new ApplicationException (ex.Message);
            }



        }

pikou pikou

unread,
Jan 26, 2015, 5:38:23 AM1/26/15
to npgsq...@googlegroups.com
Hello I would like to add that the mono version being used is 3.2.3 which from the mono project website is over 1 year old. Maybe if I upgrade to latest the problem will be fixed.

I will try this and post back.


On Sunday, January 25, 2015 at 10:56:11 PM UTC+2, pikou pikou wrote:
Reply all
Reply to author
Forward
0 new messages