在这里寻找一些指导/最佳实践,以及下游的运输合同参考组件。
所以说我拥有ProjectA的SolutionA输出:
- bin\Release\ProjectA.dll
- bin \ Release。\\ CodeContracts \\ \\ ProjectA.Contracts.dll
我们的CI服务器上的构建后步骤将此构建输出复制到特定的LocationA(特定的构建工件文件夹)
然后我们有SolutionB,它有ProjectB,在LocationA中引用了ProjectA。静态检查器选择ProjectA.Contracts.dll就好了。一切都很好。
SolutionB的构建输出是:
- bin \ Release\ProjectA.dll
- bin \Release\ProjectB.dll
- bin\Release\CodeContracts\ProjectB.Contracts.dll
注意,ProjectA.Contracts.dll不是构建输出的一部分。构建后步骤将此输出复制到LocationB。
现在,我们有第三个解决方案SolutionC,它具有ProjectC,具有依赖性在ProjectB上,因此ProjectA也在 LocationB 中 。我不想在LocationA中引用ProjectA.dll,因为它可能是ProjectB尚未构建的版本。
这里的问题是静态检查器在分析ProjectC时无法访问ProjectA.Contracts.dll,因此有警告。
我想到的我会就像是让ProjectB的输出看起来像:
- bin \ Release \\ _ProjectA.dll
- bin \ Release \ ProjectB .dll
- bin \ Release \CodeContracts\ProjectA.Contracts.dll < - 在输出中包含此内容
- bin \\ \\ Release\CodeContracts\ProjectB.Contracts.dll
相应地,我希望ProjectC的输出看起来像:
- bin \Release\ProjectA.dll
- bin\Release\ProjectB.dll
- bin\Release\ProjectC.dll
- bin\Release\CodeContracts\ProjectA.Contracts.dll
- bin \ Release CodeContracts\ProjectB.Contracts.dll
- bin\Release\CodeContracts\ProjectC.Contracts.dll
等。
首先,这是一个合理的要求,还是我认为它完全错了?如果这是合理的,那么在构建输出中包含* .Contracts.dll以获取特定参考的最佳方法是什么? Afaik,一个不应该直接引用* .Contracts.dll 。
另外,作为评论,我们的团队更喜欢合同组件输出到同一个目录作为项目的dll,即没有\CodeContracts\子目录。有什么特别的原因吗?
干杯,
Damian
解决方案有人吗? :|
Hi,
looking for some guidance / best practice here with respects to shipping contract reference assemblies downstream.
So say I have SolutionA that has ProjectA that outputs:
- bin\Release\ProjectA.dll
- bin\Release\CodeContracts\ProjectA.Contracts.dll
A post build step on our CI server copies this build output to a specific LocationA ( a build artifact folder to be specific)
Then we have SolutionB, that has ProjectB, that has a reference to ProjectA in LocationA. The static checker picks ProjectA.Contracts.dll just fine. All good.
The build output from SolutionB is:
- bin\Release\ProjectA.dll
- bin\Release\ProjectB.dll
- bin\Release\CodeContracts\ProjectB.Contracts.dll
Note, ProjectA.Contracts.dll is not part of the build output. Post build step copies this output to LocationB.
Now, we have a third solution, SolutionC, that has ProjectC, that has dependency on ProjectB and therefore ProjectA also, in LocationB . I don't want to reference ProjectA.dll in LocationA as it may be a version that ProjectB hasn't yet built against.
The problem here is that static checker, when analyzing ProjectC, has no access to ProjectA.Contracts.dll and so has warnings.
What I think I would like is to have ProjectB's output look like:
- bin\Release\ProjectA.dll
- bin\Release\ProjectB.dll
- bin\Release\CodeContracts\ProjectA.Contracts.dll <- include this in output
- bin\Release\CodeContracts\ProjectB.Contracts.dll
And correspondingly, I'd like ProjectC's output to look like:
- bin\Release\ProjectA.dll
- bin\Release\ProjectB.dll
- bin\Release\ProjectC.dll
- bin\Release\CodeContracts\ProjectA.Contracts.dll
- bin\Release\CodeContracts\ProjectB.Contracts.dll
- bin\Release\CodeContracts\ProjectC.Contracts.dll
etc.
Firstly, is this a reasonably request, or am I thinking about it completely wrong? If it's reasonable, what is the best way to include the *.Contracts.dll for specific reference in the build output? Afaik, one is not supposed to reference a *.Contracts.dll directly.
Also, as a comment, our team would prefer if the Contracts assemblies were outputted to the same directory as the project's dll, i.e. not have a \CodeContracts\ sub directory. Any particular reason for that?
Cheers,
Damian
解决方案 Anyone? :|更多推荐
运送合同参考装配
发布评论