代码合同 - 重写器因缺少引用而失败
我正在尝试对我拥有的一些库使用代码契约。我的库 A 引用了第三方库 B。库 C 引用了 A,并且从不使用 B,也不使用 A 中使用 B 的位。尽管尝试查找库 B,重写器还是失败。A 的引用程序集存在,我希望重写者对此感到满意。
关于如何构建这个,除了将 A 中依赖于 B 的位移到自己的程序集中之外,有什么想法吗?
编辑:要回答一个问题,是的,A 中有公共类型,它们公开 B 中的类型。我希望这些分析能够在库 A 结束,并且它将把 B 视为根本没有引用程序集(即,忽略它)。
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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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.