473,383 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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
--
Nov 17 '05 #1
6 3602
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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2
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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
> 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
--
Nov 17 '05 #4
> 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
--
Nov 17 '05 #5
> 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
--
Nov 17 '05 #6
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.)

Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: andrew | last post by:
Hi, i have a problem that i can't solve for quite a long time. I created a dll with C# and added a reference to it in my project. i create an object from that dll (TableControl), in this object...
1
by: Benjamin | last post by:
I am making a Windows EXE (.NET Visual Basic Windows Application). I would like to make it possible to open Excel Worksheets from my EXE. This should work independent of Excel version on client...
1
by: D. Bron | last post by:
Hello, Can anyone tell me why I'm getting the following exception: Method not found: Void Maple.Collections.Set.UnionAll(System.Collections.ICollection) I'm not using reflection, I'm not...
0
by: Gos | last post by:
I have a form object (I pass form object into variable obj and do late binding) to be passed as an argument. Dim Prop As String Dim Properties As Type Private Sub LoadObjectSettings(ByRef...
0
by: Harry F. Harrison | last post by:
Hi folks, I'm getting the following error message using the System.Activator.CreateInstance shared method: A first chance exception of type 'System.MissingMethodException' occurred in...
0
by: Tim Anderson | last post by:
I have a multi-project solution imported from VS 2003. It includes an exe and several dlls. If I add a method to a class in a DLL project, and then call it from exe project, this is picked up by...
1
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references...
1
by: S Clough | last post by:
I've got a VS2005 solution (written in C# and OpenGL) with an executable, that calls lots of sub project dlls (which are in the same solution). I briefly changed the main project to a dll (class...
4
by: Rob Blackmore | last post by:
Hi, Can anyone advise how to call a private constructor using reflection? I currently get the above error which is rectified by changing the New() to Public from Friend but I ideally wish to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.