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