[Mono-dev] issue with delegate and annonymous methods

Dario Quintana contacto at darioquintana.com.ar
Mon Jul 2 17:23:02 EDT 2007


I've update mono from the SVN. Now, 1 question, you have tested the
example with NAnt or Monovelop ?
Because with monodevelop it's working, but when I run NAnt I still got
the message:
 [csc] /home/dario/monosms/src/Mono.Sms/Main.cs(281,49): error CS0103:
The name `Agenda' does not exist in the context of
`<>c__CompilerGenerated0'

Thanks and regards

On 7/2/07, Dario Quintana <contacto at darioquintana.com.ar> wrote:
> Ok I gonna try to use the svn version. Now I'm using the Ubuntu
> package for Mono 1.2.4, maybe it's fixed.
>
> Regards
>
> On 7/2/07, Marek Safar <marek.safar at seznam.cz> wrote:
> > Hello Dario,
> >
> > I could not reproduce the issue with SVN version of gmcs.
> > Can you try to use SVN version of gmcs ?
> >
> > Regards,
> > Marek
> > > I'm using mono1.2.4, and I got this error when I run this application:
> > > http://darioquintana.com.ar/temp/monosms.zip
> > >
> > >       [csc] D:\monosms\src\Mono.Sms\Main.cs(281,49): error CS0103: The name `Age
> > > nda' does not exist in the context of `<>c__CompilerGenerated0'
> > >       [csc] Compilation failed: 1 error(s), 0 warnings
> > >
> > > The zip include the NAnt build file to compile.
> > >
> > > The class http://monosms.googlecode.com/svn/trunk/src/Mono.Sms/Main.cs
> > > works fine with this method:
> > >
> > >  private void btnAddContact_Click(object sender, EventArgs e)
> > >         {
> > >             Contacts frm = new Contacts();
> > >             frm.Operation = Operation.Add;
> > >
> > >             //bug en gmcs:
> > >             //frm.ContactsEventHandler += delegate(Contact contact,
> > > Operation op)
> > >             //                                {
> > >             //                                    Agenda.AddContact(contact);
> > >             //                                    LoadContacts();
> > >             //                                };
> > >
> > >             //Uso esto hasta que lo reparen !
> > >             frm.ContactsEventHandler += AddContact;
> > >
> > >             frm.ShowDialog();
> > >         }
> > >
> > > But with this I got the named exception:
> > >
> > >     private void btnAddContact_Click(object sender, EventArgs e)
> > >         {
> > >             Contacts frm = new Contacts();
> > >             frm.Operation = Operation.Add;
> > >
> > >             //bug en gmcs:
> > >             frm.ContactsEventHandler += delegate(Contact contact, Operation op)
> > >                                             {
> > >                                                 Agenda.AddContact(contact);
> > >                                                 LoadContacts();
> > >                                             };
> > >
> > >             //Uso esto hasta que lo reparen !
> > >             //frm.ContactsEventHandler += AddContact;
> > >
> > >             frm.ShowDialog();
> > >         }
> > >
> > >
> >
> >
> >
>
>
> --
> Dario Quintana
> http://blog.darioquintana.com.ar
>


-- 
Dario Quintana
http://blog.darioquintana.com.ar



More information about the Mono-devel-list mailing list