|
|
|
Community Member
|
|
It appears that a task implementing IAnnotationProvider has stricter requirements that just implementing the GetAnnotations() method. If I return an enumerator for AnnotationInstances that I have constructed with the necessary MetaDataDeclaration (in my case a MethodDefDeclaration for the method I am trying to programmatically annotate) and custom attribute constructor, the MultiCastAttributeTask fails trying to cast the AnnotationInstance to a CustomAttributeDeclaration. If I return an enumerator for CustomAttributeDeclarations I have constructed (which seems like the wrong thing to do anyway), the AnnotationRepositoryTask fails with a null reference exception (trying to add an item to a dictionary using null as the key).
What all is necessary to implement IAnnotationProvider? It was my hope that one could simulate annotation of third party assemblies (system assemblies in particular) by doing this.
|
|
|
|
|
Gael Fraiteur
SharpCrafters
|
|
|
If MultiCastAttributeTask fails with a cast exception, you may consider it a bug of PostSharp. The vision is that you provide an IAnnotationInstance, not a CustomAttributeDeclaration. So please report this as a bug.
|
|
|
|