L
localhost
I have a classdecorated with a custom attribute.
I tried to load it and inspect the attributes with Reflection. Within
my code, I am never able to find the custom attribute. However, if I
fire up QuickWatch from within VS.NET 2003, I can see the attribute
clearly.
Namespaces are fully qualified and etc. Why would things not work?
Assembly tempAsy = Assembly.LoadFrom( @"test.dll" );
foreach ( System.Reflection.Module subModule in tempAsy.GetModules() )
{
foreach ( Type childType in subModule.GetTypes() )
{
object[] typeAttributes = childType.GetCustomAttributes(
typeof(testspace.TestThing), true );
}
}
typeAttributes always shows zero items, but setting a break point and
visually inspecting with the Watch shows the attribute clearly there.
Help?
I tried to load it and inspect the attributes with Reflection. Within
my code, I am never able to find the custom attribute. However, if I
fire up QuickWatch from within VS.NET 2003, I can see the attribute
clearly.
Namespaces are fully qualified and etc. Why would things not work?
Assembly tempAsy = Assembly.LoadFrom( @"test.dll" );
foreach ( System.Reflection.Module subModule in tempAsy.GetModules() )
{
foreach ( Type childType in subModule.GetTypes() )
{
object[] typeAttributes = childType.GetCustomAttributes(
typeof(testspace.TestThing), true );
}
}
typeAttributes always shows zero items, but setting a break point and
visually inspecting with the Watch shows the attribute clearly there.
Help?