reflection code access security?
Does anyone have any information on reflection and code-access-security? I am assuming code-access-security based on the results I am seeing. I am searching a directory for assemblies that contain custom attributes. If I first run my search on the directory where my search app is running from, I find all the custom attributes, and can then find them in other directories as well. If I search another directory first, then I will find none on any search, even in the project directory.
When I say "not found" here is some more detail:
The Custom attributes are attached to a class in the assembly. I am able to reflect down to the class type in the assembly, and [type].getcustomattributes(false) does return the attributes. However, I cannot cast them as MyAttribute objects, and access their properties. If I print out the attribute.gettype.tostring I get "MyAttributes.MyAttribute". So, the attribute is there, I can access it, but I cannot treat it as an instance of MyAttribute or compare it to one. This does not happen when I run the search on the project directory first.
Is there some code-access-security issue that I need to take into consideration here?
Any info or help on this is greatly appreciated.
Thanks
|