problems with attributes
i'm having a very weird problem with attributes.
see, i've got this custom attribute. i use this attribute in an assembly. then, i load that assembly from a filepath. i run through all the types in the assembly and look for the attributes. here's some code that demonstrates this behavior:
private void AddMethodTraqIssue(Type t, ref IssueCollection issueCollection)
{
foreach(MethodInfo mi in t.GetMethods())
{
foreach(Attribute att in mi.GetCustomAttributes(true))
{
Repository.IssueTracker.IssueAttribute attIssue =
att as Repository.IssueTracker.IssueAttribute;
if(attIssue != null)
{
// TODO: don't leave this concatenation in here during production release.
Issue issu = new Issue(attIssue,mi.Name,t.Namespace + "." + t.Name);
// make sure we've got a valid collection with something in it
if(issueCollection == null)
{
issueCollection = new IssueCollection(issu);
}
else
{
issueCollection.Add(issu);
}
}
}
}
}
i execute this code from an aspx page and it works wonderfully. this code, mind you, is in a separate library project that the aspx project has a reference to. i've also got a windows forms project, which calls the same method, with the same parameters on the same dll. guess what - every time i perform the procedure to "get the custom attribute as a specified type of custom attribute," the attribute comes back as "undefined."
weird - it works wonderfully in aspx, but not at all in windows forms. anyone have any ideas?