• <legend id='7Rbg1'><style id='7Rbg1'><dir id='7Rbg1'><q id='7Rbg1'></q></dir></style></legend>
    • <bdo id='7Rbg1'></bdo><ul id='7Rbg1'></ul>
    <i id='7Rbg1'><tr id='7Rbg1'><dt id='7Rbg1'><q id='7Rbg1'><span id='7Rbg1'><b id='7Rbg1'><form id='7Rbg1'><ins id='7Rbg1'></ins><ul id='7Rbg1'></ul><sub id='7Rbg1'></sub></form><legend id='7Rbg1'></legend><bdo id='7Rbg1'><pre id='7Rbg1'><center id='7Rbg1'></center></pre></bdo></b><th id='7Rbg1'></th></span></q></dt></tr></i><div id='7Rbg1'><tfoot id='7Rbg1'></tfoot><dl id='7Rbg1'><fieldset id='7Rbg1'></fieldset></dl></div>

    <small id='7Rbg1'></small><noframes id='7Rbg1'>

    1. <tfoot id='7Rbg1'></tfoot>

        Microsoft 代码合同和 CI 构建服务器

        Microsoft Code Contracts and CI build server(Microsoft 代码合同和 CI 构建服务器)

            <tfoot id='xINRP'></tfoot>
            <i id='xINRP'><tr id='xINRP'><dt id='xINRP'><q id='xINRP'><span id='xINRP'><b id='xINRP'><form id='xINRP'><ins id='xINRP'></ins><ul id='xINRP'></ul><sub id='xINRP'></sub></form><legend id='xINRP'></legend><bdo id='xINRP'><pre id='xINRP'><center id='xINRP'></center></pre></bdo></b><th id='xINRP'></th></span></q></dt></tr></i><div id='xINRP'><tfoot id='xINRP'></tfoot><dl id='xINRP'><fieldset id='xINRP'></fieldset></dl></div>
            <legend id='xINRP'><style id='xINRP'><dir id='xINRP'><q id='xINRP'></q></dir></style></legend>

                <bdo id='xINRP'></bdo><ul id='xINRP'></ul>

                <small id='xINRP'></small><noframes id='xINRP'>

                  <tbody id='xINRP'></tbody>
                • 本文介绍了Microsoft 代码合同和 CI 构建服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我们正在迁移到 .NET 4,并且对实现新的按合同设计功能非常感兴趣.

                  我们知道 一书致敬,了解命令行工具.p>

                  We are migrating to .NET 4 and very interested in implementing new Design By Contract capabilities.

                  As we know Code Contract engine requires installation of Code Contract addin
                  and VS Ultimate or Premium (for static checking).

                  Here is my questions:

                  1. Can I use code contract rewriting without installing VS on CI build Server (TeamCity)?
                  2. Is there any msbuild tasks to execute Contract checking?
                  3. Do you use Code Contract's validation with CI builds?

                  解决方案

                  Can I use code contract rewriting without installing VS on CI build server (TeamCity)?

                  Yes. Install CodeContracts on the build server. (If it refuses to install on a machine without Visual Studio, just copy the files listed below, and their dependencies, onto the build server.) Once installed, you'll find the CodeContract tools installed in %programfiles%MicrosoftContractsBin. In that directory, there are 4 executables you'll be interested in:

                  1. ccrewrite.exe - The binary rewriter. This should be executed after compilation. It turns your contracts into runtime checks or whatever you specify you want them turned into.

                  2. ccrefgen.exe - This can generate contract reference assemblies alongside your assemblies. This is useful if you're shipping dlls to be consumed by other parties.

                  3. cccheck.exe - The static checker. On the build server, you'd run this tool over your assemblies containing contracts, and it will spit out warnings and messages as it encounters potential problems.

                  4. ccdocgen.exe - This generates XML documentation from the contracts in your code. You might want to use this if you're shipping dlls with contracts for consumption by other parties, or if you just need internal docs on your code.

                  Is there any msbuild tasks to execute Contract checking?

                  Yes. There are 2 MSBuild tasks shipping with CodeContracts: in the same CodeContracts installation directory, check out the MSBuild[framework version] folder. In that directory, there are 2 files that should help you out: Microsoft.CodeContracts.targets and Microsoft.CodeContractAnalysis.targets.

                  According to the CodeContracts documentation,

                  An msbuild script extension Microsoft .Contract. targets contains the extra build actions for the runtime contract instrumentation and static verification steps. As a result of this approach, it is possible to use the same functionality when building from the command line with the msbuild command. Using msbuild on a project or solution that uses contracts enabled via the VS user interface will perform the same actions as the corresponding build under VS.

                  As you can see, it is possible and supported to integrate the tools into CI builds via the MSBuild targets.

                  Do you use Code Contract's validation with CI builds?

                  Assuming you mean static checking with warnings/messages, I've done this personally, but haven't done this on a big project.

                  I hope this helps!

                  Hat tip to Jon Skeet's C# In Depth book for explanation of the command line tools.

                  这篇关于Microsoft 代码合同和 CI 构建服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Force JsonConvert.SerializeXmlNode to serialize node value as an Integer or a Boolean(强制 JsonConvert.SerializeXmlNode 将节点值序列化为整数或布尔值)
                  Using JSON to Serialize/Deserialize TimeSpan(使用 JSON 序列化/反序列化 TimeSpan)
                  Could not determine JSON object type for type quot;Classquot;(无法确定类型“Class的 JSON 对象类型.)
                  How to deserialize a JSONP response (preferably with JsonTextReader and not a string)?(如何反序列化 JSONP 响应(最好使用 JsonTextReader 而不是字符串)?)
                  how to de-serialize JSON data in which Timestamp it-self contains fields?(如何反序列化时间戳本身包含字段的JSON数据?)
                  JSON.Net custom contract serialization and Collections(JSON.Net 自定义合约序列化和集合)

                    <legend id='T86pj'><style id='T86pj'><dir id='T86pj'><q id='T86pj'></q></dir></style></legend>
                      <tbody id='T86pj'></tbody>
                    <i id='T86pj'><tr id='T86pj'><dt id='T86pj'><q id='T86pj'><span id='T86pj'><b id='T86pj'><form id='T86pj'><ins id='T86pj'></ins><ul id='T86pj'></ul><sub id='T86pj'></sub></form><legend id='T86pj'></legend><bdo id='T86pj'><pre id='T86pj'><center id='T86pj'></center></pre></bdo></b><th id='T86pj'></th></span></q></dt></tr></i><div id='T86pj'><tfoot id='T86pj'></tfoot><dl id='T86pj'><fieldset id='T86pj'></fieldset></dl></div>
                  • <tfoot id='T86pj'></tfoot>

                      1. <small id='T86pj'></small><noframes id='T86pj'>

                          • <bdo id='T86pj'></bdo><ul id='T86pj'></ul>