473,396 Members | 2,102 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,396 software developers and data experts.

MissingMethodException without Reflection, COM, DLLs, or anything else.

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 using COM, and I'm not referencing
external DLLs (only other projects in the same solution). If this method
were really "missing", I would expect a build time error, not a run time
error. But my solution compiles fine, and even Intellisense shows me the
UnionAll method.

MSDN and Google have no answers. The most relevant thing I could find was
MSKB article 834063 (http://support.microsoft.com/?kbid=834063), which is
about COM objects (I tried implementing its solution anyway, by adding a
set accessor, but that didn't solve the problem).

So, if anyone can help, I would appreciate it. Here is the relevant code:

The exception occurs on the following line:

this.GrantedPermissions.Grant(r.GrantedPermissions );

Where both 'this.GrantedPermissions' and 'r.GrantedPermissions' are of type
'Maple.Security.PermissionSet : System.Collections.ICollection' which has
the following polymorphic definition for 'Grant':

public void Grant(Permission p)
{
this.ps.Union(p);
}
public void Grant(PermissionSet s)
{
this.ps.UnionAll(s);
}

Where 'this.ps' is of type 'Maple.Collections.Set', which has the following
two relevant definitions:

public void Union(object o)
{
if (! this.al.Contains(o))
{
this.al.Add(o);
}
}

public void UnionAll(System.Collections.ICollection s)
{
foreach(object o in s)
{
if(! this.al.Contains(o))
{
this.al.Add(o);
}
}
}

Where 'this.al' is of type System.Collections.ArrayList.

I'm using .NET Framework version 1.1. Maple.Security and Maple.Permissions
are in seperate assemblies, linked by am intra-solution a project
reference.

Note that if I rename 'UnionAll' to 'Union' (and thus make it a polymorphic
definition), I don't get the MissingMethodException, but the wrong overload
of Union is called (object o instead of System.Collections.ICollection s).

Thanks for any help,

-D. Bron
Nov 16 '05 #1
1 1747
"D. Bron" <db***@dbron.net.NOSPAM> wrote in
news:Xn*******************@207.46.248.16:

In lieu of either Union + UnionAll (which doesn't work), and polymorphism
(which doesn't work), I've redefined Union thus:
public void Union(object o)
{

if(!o.GetType().IsSubclassOf(typeof(System.Collect ions.ICollecti
on)))
{
if (! al.Contains(o))
{
this.al.Add(o);
}
}
else
{
System.Collections.ICollection s =
(System.Collections.ICollection) o;

foreach(object oo in s)
{
if(! this.al.Contains(oo))
{
this.al.Add(oo);
}
}

}
}

Not only does this not solve my problem, it causes even weirder effects.
For one thing, the line highlighting in debug mode is all off. When
stepping through it, blank lines and partial lines are highlighted. Also,
I never get into the 'else' branch; the 'if' branch is always chosen. When
I tried to debug this by changing:

if(!o.GetType().IsSubclassOf(typeof(System.Collect ions.ICollection)))

to
System.Type ot = o.GetType();
System.Type ct = typeof(System.Collections.ICollection);
if(!ot.IsSubclassOf(ct))

Then I cannot interrogate the values of 'ot' and 'ct' at debug time; I am
told they are 'out of scope' even though I'm within the definition of
Union.

Curiouser and Curiouser,

-D. Bron
Nov 16 '05 #2

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

Similar topics

2
by: forvino | last post by:
Hi Geeks, Ihave a doubt in dotNet reflection. I m developing a tool which will returns set of public(access specifier) methods of the selected assembly. this works completely fine,...
10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
2
by: forvino | last post by:
Hi Geeks, Ihave a doubt in dotNet reflection. I m developing a tool which will returns set of public(access specifier) methods of the selected assembly. this works completely fine,...
6
by: Chris Jackson | last post by:
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...
12
by: Mike | last post by:
I found this question before I asked mine: ----<previous question>---- We are clearly going about this the wrong way so before we get too far I would like some advice. We have all common...
0
by: forvino | last post by:
Hi Geeks, Ihave a doubt in dotNet reflection. I m developing a tool which will returns set of public(access specifier) methods of the selected assembly. this works completely fine,...
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: 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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.