M
michal_januszczyk
what may be the reason for the following behaviour:
//I load an assembly from dll.
Assembly asembly = Assembly.LoadFrom(dllFullPath);
//then I get all Types from the assembly
types = asembly.GetTypes();
flags = (BindingFlags.Public|BindingFlags.Static|
BindingFlags.Instance|BindingFlags.DeclaredOnly);
//and next, I try to load some method infos from type.
foreach (type in types)
{
MethodInfo[] mInfos = type.GetMethods(flags);
//and at the very end I try to get some custom attribues
//defined for the method.
attributes = mi.GetCustomAttributes(typeof (
Common.DescriptionAttribute),false);
if(attributes.Length >0)
{
//do somethong with the attributes...
}
}
The most strange thing for me is the fact, that when
dllFullPath points to some deeply nested directory (with
the project), the custom attributes are not found. But
when I copy the _very same_ DLL to root directory of
drive, all attributes are found. (?)
What may be the reason for such behaviour ?
Plese help
Michal Januszczyk
//I load an assembly from dll.
Assembly asembly = Assembly.LoadFrom(dllFullPath);
//then I get all Types from the assembly
types = asembly.GetTypes();
flags = (BindingFlags.Public|BindingFlags.Static|
BindingFlags.Instance|BindingFlags.DeclaredOnly);
//and next, I try to load some method infos from type.
foreach (type in types)
{
MethodInfo[] mInfos = type.GetMethods(flags);
//and at the very end I try to get some custom attribues
//defined for the method.
attributes = mi.GetCustomAttributes(typeof (
Common.DescriptionAttribute),false);
if(attributes.Length >0)
{
//do somethong with the attributes...
}
}
The most strange thing for me is the fact, that when
dllFullPath points to some deeply nested directory (with
the project), the custom attributes are not found. But
when I copy the _very same_ DLL to root directory of
drive, all attributes are found. (?)
What may be the reason for such behaviour ?
Plese help
Michal Januszczyk