MissingMethodException Confusion

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default MissingMethodException Confusion

    OK, this one has me completely confused. Here's the situation:

    I have a home-rolled session management system, which allows me to share
    session state between my ASP.NET applications and my ASP Classic
    applications.

    To do this, I have a SessionPage class, which is what I inherit all of my
    pages from, and a SessionUserControl class, which is what I inherit all of
    my user controls from.

    One of the public methods in both is: void abandonSession();

    If I call this from a user control, then it simply executes the following
    code in the base class:

    public void abandonSession() {
    SessionPage parentPage = (SessionPage)this.Page;
    parentPage.abandonSession();
    }

    This works like a charm. If, however, I have a page inheriting from
    SessionPage, and I just call:

    this.abandonSession();
    or
    base.abandonSession();
    or
    ((SessionPage)this).abandonSession();
    or any of about 100 other permutations of referencing the object...

    ....then I get a System.MissingMethodException. Method not found: Void <my
    project>.SessionPage.abandonSession().

    I beg to differ - I can find the method, Intellisense can find the method,
    ildasm can find the method, the user control class can find the method - why
    can't my page find this method???!!!

    Is there anything that can be done to get this to work? I can include the
    user control, so it's not blocking my progress, but it just seems inane that
    I would need to have this extra file. Am I missing something obvious? I'm
    using the 1.1 runtime, the class I am inheriting from is in another assembly
    which I have updated the reference to, and it is registered for COM Interop.
    I am out of ideas - I give up. Help?

    --
    Chris Jackson
    Software Engineer
    --


    Chris Jackson Guest

  2. Similar Questions and Discussions

    1. emf confusion
      Can anyone tell me what has happened in the settings of Freehand 8 when this problem occurs: Whereas FH drawings that were made months ago, and...
    2. ai. vs pdf confusion
      My illustrator 10 is not cooperating. After making a file going to file>save>format adobe illus and leaving all options clicked, i hit "ok". the file...
    3. Net Confusion
      It should work, but this problem is notorious to VS.NET. See...
    4. CD/RW Confusion?
      I need a primer on writing to a CD/RW disk. My current drive supports CD/RW disks, but for some reason I keep getting error messages when I try to...
    5. eps confusion
      FH has the ability to edit some EPS file, but not all. In fact eps files FH exports are not editable unless you check "Include Freehand". If you have...
  3. #2

    Default Re: MissingMethodException Confusion

    Hi,

    Check that SessionPage.dll exist with the correct version in the
    application directory and GAC (if exist). it sound like you reference
    correct DLL in design time but wrong one in run time. Usually wrong
    versions in GAC and bin directory cause this.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  4. #3

    Default Re: MissingMethodException Confusion

    > Check that SessionPage.dll exist with the correct version in the
    > application directory and GAC (if exist). it sound like you reference
    > correct DLL in design time but wrong one in run time. Usually wrong
    > versions in GAC and bin directory cause this.
    I have done this. In fact, just to be sure, in VS.NET I deleted the old
    reference and created a new one, and then rebuilt. This did not solve the
    problem. I'm still able to access it from a user control calling the
    function from the parent page, but not from the parent page itself.

    --
    Chris Jackson
    Software Engineer
    --


    Chris Jackson Guest

  5. #4

    Default Re: MissingMethodException Confusion

    > Is the Base class for SessionPage is in another assembly? Are they in same
    > folder? You may try to refer the copy in same folder to see if it will
    help.

    All of the pages in my application reside in one assembly.

    They derive from my SessionPage class, which resides in a separate assembly.
    This assembly is in the GAC, and it is being found.

    The methods of the class that handle the session management are all
    working - the code from my overrides all executes.

    Additionally, I can call the public abandonSession() function from my ASCX
    pages, which derive from SessionUserControl in the same assembly as
    SessionPage. Moreover, this function is able to call the abandonSession()
    function from the SessionPage class - I just can't do so directly from a
    page that derives from . This is what I do in my ASCX page that works:

    public void abandonSession() {

    SessionPage parentPage = (SessionPage)this.Page;

    parentPage.abandonSession();

    }


    SessionPage inherits from System.Web.UI.Page, and SessionUserControl
    inherits from System.Web.UI.UserControl.

    It's just ... weird...

    I have tried every permutation of casting I can think of to determine if
    this is the issue, and I'm still lost. What else can I look at to determine
    why I am seeing this behavior?


    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows XP
    Windows XP Associate Expert
    --


    Chris Jackson Guest

  6. #5

    Default Re: MissingMethodException Confusion

    You may try to search how many copies there are on your local computer,
    there may be an incorrect version somewhere, try just keep one copy in the
    same folder with your assembly.

    Luke

    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Luke Zhang [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139