i have an assembly loaded into my app. im trying to get at the attributes of this assembly so i have this code :
the problem is that i cant cast the return of "getCustomAttributes to an AssemblyTypeName array. i can get the return values when i use this:
the problem is that when i try this:
i get an error here trying to cast the object to an AssemblyTypeName. what should i do? i can see my custom attribute and its value when i hover over the array and look at its contents , but i cant get to it.
Just so youl know, assemblyTypeName is my own attribute that i created.
i keep getting the error
"unable to cast object of type "EmpManagment.AssemblyTypeName" to type "EmpManagment.AssemblyTypeName"
Code:
foreach(Type OT in objDll.GetTypes())
{
AssemblyTypeName[] custInfo = (AssemblyTypeName[])OT.GetCustomAttributes(false);
}
Code:
foreach(Type OT in objDll.GetTypes())
{
Object [] custInfo = (AssemblyTypeName[])OT.GetCustomAttributes(false);
}
Code:
foreach( Object o in custInfo)
{
AssemblyTypeName atn = (AssemblyTypeName)o;
atn.mycustomAttribute........
}
i get an error here trying to cast the object to an AssemblyTypeName. what should i do? i can see my custom attribute and its value when i hover over the array and look at its contents , but i cant get to it.
Just so youl know, assemblyTypeName is my own attribute that i created.
i keep getting the error
"unable to cast object of type "EmpManagment.AssemblyTypeName" to type "EmpManagment.AssemblyTypeName"
Last edited: