代码合同-重写器因缺少参考而失败 [英] Code contracts - Rewriter fails with missing reference

查看:98
本文介绍了代码合同-重写器因缺少参考而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对我拥有的某些库使用代码协定。我的库A引用了ThirdParty库B。库C引用了A,并且从不使用B,也没有使用使用B的A的位。重写器虽然尝试查找库B失败,但A的引用程序集存在,我希望重写者对此感到满意。

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.

任何关于如何构建它的想法,都没有将依赖B的A中的位移到其自己的程序集中?

Any ideas on how I can build this, short of moving the bits in A that rely on B out into its own assembly?

编辑:要回答一个问题,是的,A中有一些公共类型,它们公开了B中的类型。我希望那些分析将在库A处结束,并且希望它将B视为存在完全没有参考程序集(即忽略它)。

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).

推荐答案

似乎没有办法解决。在某些方面,我认为它很好,因为它可以帮助您查看第三方依赖项在哪里泄漏。

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.

这篇关于代码合同-重写器因缺少参考而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆