Why do I (sometimes) have to reference assemblies referenced by the assembly I reference?

后端 未结 5 1118
名媛妹妹
名媛妹妹 2020-12-06 10:53

I have an assembly A that defines an interface with some overloads:

public interface ITransform
{
    Point InverseTransform(Point point);
    Rect InverseTr         


        
5条回答
  •  情深已故
    2020-12-06 11:22

    That method makes use of something defined in System.Drawing. If you uncomment it then that assembly no longer will by trying to use System.Drawing; hence, no requirement.

    Think of it this way, when you go off to perform your action .NET says ok I'm making a call to this guy defined in this assembly and looks for the appropriate code to execute. It can't find it so it throws up it's hands and says I give up you tell me where it is.

    Just make it a habit of referencing every DLL you might potentially use.

提交回复
热议问题