开发者

Where did my custom attribute assembly reference go?

开发者 https://www.devze.com 2023-02-02 07:49 出处:网络
I\'ve got the following code in AssemblyA: [TypeConverter(typeof(AssemblyB.TestTypeConverter))] public class TestClass

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号