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

B

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
 
O

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top