问题
I'm trying to use code contracts for some libraries I have. My library A has a reference to ThirdParty library B. Library C references A, and never uses B nor does it use the bits of A that use B. The rewriter fails though trying to find library B. The reference assembly for A exists, I was hoping that the rewriter would be just happy with that.
Any ideas on how I can build this, short of moving the bits in A that rely on B out into its own assembly?
EDIT: To answer a question, yes, there are public types in A which expose types in B. I was hoping those the analysis would end at the library A, and that it would treat B as if there was no reference assembly at all (ie, ignore it).
回答1:
It seems that there is no way around this. In some regards I think its good as it helps you see where your third party dependencies are leaking.
来源:https://stackoverflow.com/questions/7720652/code-contracts-rewriter-fails-with-missing-reference