1. <legend id='YILpc'><style id='YILpc'><dir id='YILpc'><q id='YILpc'></q></dir></style></legend>

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

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

      如何在 Visual Studio 2008 中创建自定义清理(清理后)事件?

      How to create custom clean (post-clean) event in Visual Studio 2008?(如何在 Visual Studio 2008 中创建自定义清理(清理后)事件?)
    1. <small id='Ony0E'></small><noframes id='Ony0E'>

      <legend id='Ony0E'><style id='Ony0E'><dir id='Ony0E'><q id='Ony0E'></q></dir></style></legend>
    2. <tfoot id='Ony0E'></tfoot>

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

                <tbody id='Ony0E'></tbody>

                <i id='Ony0E'><tr id='Ony0E'><dt id='Ony0E'><q id='Ony0E'><span id='Ony0E'><b id='Ony0E'><form id='Ony0E'><ins id='Ony0E'></ins><ul id='Ony0E'></ul><sub id='Ony0E'></sub></form><legend id='Ony0E'></legend><bdo id='Ony0E'><pre id='Ony0E'><center id='Ony0E'></center></pre></bdo></b><th id='Ony0E'></th></span></q></dt></tr></i><div id='Ony0E'><tfoot id='Ony0E'></tfoot><dl id='Ony0E'><fieldset id='Ony0E'></fieldset></dl></div>
                本文介绍了如何在 Visual Studio 2008 中创建自定义清理(清理后)事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在我们的构建过程中,对于每个项目,我们使用构建后事件将我们的可执行文件复制到单独的部署目录中.这很有效,但问题是我们在执行清理解决方案/清理项目后遇到了陈旧文件的问题.我想设置一个清理"事件来删除复制的文件,而 Visual Studio 2008 似乎没有在项目属性页面中提供选项.

                In our build process, for each project we use Post Build events to copy our executable files into a separate deployment directory. That works just peachy, but the problem is that we run into problems with stale files after performing a Clean Solution/Clean Project. I'd like to set up a "Clean" event that deletes the copied file and Visual Studio 2008 does not seem to provide an option in the project properties page.

                它有:

                Build Events:
                   Pre-Build Event
                   Pre-Link Event
                   Post-Build Event
                Custom Build Step
                   General
                

                我想找到的是在清理项目时执行任意命令行的某种方法.

                What I'd like to find is some way to execute an arbitrary command line when the project is cleaned.

                推荐答案

                您可以在 csproj 文件中使用 MSBuild 目标语法.例如

                You can use the MSBuild target syntax in your csproj file. e.g

                  <Target Name="AfterClean">
                    <Delete Files="$(OutDir)$(TargetName).exe" ContinueOnError="true" />
                  </Target>
                

                MSBuild 团队博客中描述了一种直接在 Visual Studio IDE 中编辑 .csproj 文件的巧妙方法,但这是我的第一篇文章,因此我只能包含一个超链接.(简而言之:卸载项目,然后右键单击它以查看条目编辑 [项目].csproj"……您的 csproj 将作为一个 xml 文件出现在 IDE 中,其中包含有关元素和属性的智能感知.太棒了!)

                There is a neat way to edit your .csproj file directly in the Visual Studio IDE described in the MSBuild team blog, but this is my first post so I can only include one hyperlink. (briefly: Unload the project, then right-click on it to see the entry "Edit [project].csproj" ... your csproj will come up in the IDE as an xml file with intellisense on elements and attributes. Wonderful!)

                自定义目标的完整列表是 此处.

                A full list of custom Targets is here.

                这篇关于如何在 Visual Studio 2008 中创建自定义清理(清理后)事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                C++ stl unordered_map implementation, reference validity(C++ stl unordered_map 实现,参考有效性)
                C++: Is it possible to use a reference as the value in a map?(C++:是否可以使用引用作为映射中的值?)
                Where ampersand quot;amp;quot; can be put when passing argument by reference?(其中符号“amp;通过引用传递参数时可以放置吗?)
                Why can a non-const reference parameter be bound to a temporary object?(为什么可以将非常量引用参数绑定到临时对象?)
                What is a dangling reference?(什么是悬空引用?)
                C++ reference changes when push_back new element to std::vector(当 push_back 新元素到 std::vector 时,C++ 引用发生变化)
                <i id='87qmr'><tr id='87qmr'><dt id='87qmr'><q id='87qmr'><span id='87qmr'><b id='87qmr'><form id='87qmr'><ins id='87qmr'></ins><ul id='87qmr'></ul><sub id='87qmr'></sub></form><legend id='87qmr'></legend><bdo id='87qmr'><pre id='87qmr'><center id='87qmr'></center></pre></bdo></b><th id='87qmr'></th></span></q></dt></tr></i><div id='87qmr'><tfoot id='87qmr'></tfoot><dl id='87qmr'><fieldset id='87qmr'></fieldset></dl></div>

                  1. <small id='87qmr'></small><noframes id='87qmr'>

                      <tbody id='87qmr'></tbody>
                    <legend id='87qmr'><style id='87qmr'><dir id='87qmr'><q id='87qmr'></q></dir></style></legend>
                    • <bdo id='87qmr'></bdo><ul id='87qmr'></ul>
                    • <tfoot id='87qmr'></tfoot>