wierd c# compilation error

Hi

Can anyone explain to me why the following code compiles ok in a PocketPC 2003 project but not in a Windows smartphone 2003 project fails with the error

error CS0654: Method 'VerifyUI.PageAreaItemButton.DoRequestRepaint()' referenced without parentheses

I am using VS 2005

public delegate void RequestRepaint();
private RequestRepaint requestRepaintDelegate = DoRequestRepaint;



private void DoRequestRepaint() {}


Answer this question

wierd c# compilation error

  • Mike_Donner

    I would guess you see that because you're using different compilers for SP 2003/NETCF V1, C# 1.1 compiler; and PPC 03/NETCF V2 C# V2 compiler. Fix has been suggested already.



  • Nick Tompson

    In this case the problem came from a port from Pocket PC 2003 to Smartphone 2003 the smartphone 2003 used an earlier version of the c# compiler which did not support that syntax. I migrated the project to use windows mobiile 5 sdk which uses the same (later)compiler for both platforms, that fixed it

  • DBRICHARD

    I'm fairly new to the delegate system but could you try:

    public delegate void RequestRepaint();
    private RequestRepaint requestRepaintDelegate += new RequestRepaint(DoRequestRepaint);


  • feby

    Could you please point me to the fix so I can resolve:

    CS0654 method referenced without parnteses


  • Kurt Ipsen

    I thought it may be a compiler version problem. Anyway many thanks as this has now fixed the problem



  • wierd c# compilation error