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