473,765 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MissingMethodEx ception without Reflection, COM, DLLs, or anything else.

Hello,

Can anyone tell me why I'm getting the following exception:

Method not found:
Void Maple.Collectio ns.Set.UnionAll (System.Collect ions.ICollectio n)

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.GrantedPer missions.Grant( r.GrantedPermis sions);

Where both 'this.GrantedPe rmissions' and 'r.GrantedPermi ssions' are of type
'Maple.Security .PermissionSet : System.Collecti ons.ICollection ' which has
the following polymorphic definition for 'Grant':

public void Grant(Permissio n p)
{
this.ps.Union(p );
}
public void Grant(Permissio nSet s)
{
this.ps.UnionAl l(s);
}

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

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

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

Where 'this.al' is of type System.Collecti ons.ArrayList.

I'm using .NET Framework version 1.1. Maple.Security and Maple.Permissio ns
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 MissingMethodEx ception, but the wrong overload
of Union is called (object o instead of System.Collecti ons.ICollection s).

Thanks for any help,

-D. Bron
Nov 16 '05 #1
1 1763
"D. Bron" <db***@dbron.ne t.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(t ypeof(System.Co llections.IColl ecti
on)))
{
if (! al.Contains(o))
{
this.al.Add(o);
}
}
else
{
System.Collecti ons.ICollection s =
(System.Collect ions.ICollectio n) o;

foreach(object oo in s)
{
if(! this.al.Contain s(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(t ypeof(System.Co llections.IColl ection)))

to
System.Type ot = o.GetType();
System.Type ct = typeof(System.C ollections.ICol lection);
if(!ot.IsSubcla ssOf(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
1484
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, when the selected components are
10
7368
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 Windows.Forms.UserControl in a COM environment, i.e. I want to host that control in a COM host. So far, so good, I can host it, but I can not reach the parent COM object from the control (Parent property is null :( ). I have stopped the control in the...
2
1412
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, when the selected components are
6
3631
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 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.
12
1562
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 assemblies like our page base class etc located on our Dev server. We reference them in all our applications with Copy Local set to trued
0
881
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, when the selected components are
0
987
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 intellisense and I can successfully compile. However when I try to debug I get a MissingMethodException on the call to the new method (it is a public method of a public class, so it is not a visibility issue). I've tried Clean, and rebuilding...
1
1534
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 library), then back to an exe (windows application) but now when I try to run it I get a "MissingMethodException". I can get rid of this by selecting "Enable unmanaged code debugging" in the project options, but then I can't edit my code while...
4
5201
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 leave it as Friend to prevent it being created outside of this project. Thanks in advance Rob
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.