I've got the following code in AssemblyA
:
[TypeConverter(typeof(AssemblyB.TestTypeConverter))]
public class TestClass
{
}
开发者_运维知识库TestTypeConverter
is defined in a different assembly (AssemblyB
). This is the only reference to AssemblyB
from AssemblyA
. When I compile this & have a look in reflector, the TypeConverterAttribute is there, but AssemblyA
doesn't have any assembly references to AssemblyB.dll; it's only got mscorlib and System.dll. Where did it go, and how does .NET know to look in AssemblyB
for TestTypeConverter
?
I have tried to replicate this on my box and cannot see it. When I reference AssemblyB.TestTypeConverter in AssemblyA, Reflector correctly says that AssemblyA references AssemblyB.
Is TestClass marked up wihth the attribute in Reflector? If so, what happens when you click on the attribute in Reflector?
精彩评论