Home All Groups Group Topic Archive Search About

System.Type.GetCommonAttributes() works on c# assemblies, not managed c++ assemblies.

Author
26 Feb 2007 8:49 PM
brad
Here's the situation:  I load an assembly (using system.reflection)
and then I try to query for all methods in the assembly using
System.Type.GetCommonAttributes().

This works when my assembly was compiled from c# code.  I call
GetCommonAttributes, and I get back a method.

But, if the assembly is compiled from managed c++ code,
GetCommonAttributes returns an empty set.

the Class/function structure is identical (except for syntax, of
course), and they both have the exact same attributes.  But, for some
reason, the query works in c#, but not in mc++.

Is there an obvious reason why this would be? I'm not ruling out error
on my part (yet).  But before I investigate too deeply, I want to know
if this function works differently for mc++ and c# code.

Thanks!
--brad

Author
4 Mar 2007 2:43 PM
Oliver Sturm
Hello brad,

>Here's the situation:  I load an assembly (using system.reflection)
>and then I try to query for all methods in the assembly using
>System.Type.GetCommonAttributes().

I wanted to have a look at your problem, but I had to stop at this early
point - System.Type doesn't have a method called GetCommonAttributes. It
does on your system? Or is there something wrong with your description?

There is of course GetCustomAttributes, but to my knowledge this doesn't
return any methods, so I don't think this could be the one you're
referring to.


                Oliver Sturm

AddThis Social Bookmark Button