简体   繁体   English

MSBuild删除过程

[英]MSBuild delete process

I'm working on ironing out some problems with MSBuild on a large project. 我正在努力解决大型项目上的MSBuild问题。 As part of a custom build target in our MSBuild setup we insert the .PDB files into Symbol Storeafter the build is successful. 作为我们的MSBuild设置中自定义生成目标的一部分,我们在生成成功后将.PDB文件插入Symbol Store。 This works fine. 这很好。 However when we delete the old builds we also have to delete the .PDB files from Symbol Store, which requires a transaction ID that's generated when the symbols are inserted. 但是,当我们删除旧版本时,我们还必须从Symbol Store中删除.PDB文件,这需要插入符号时生成的事务ID。 This is output in the build debug file so not a problem to find. 这是在构建调试文件中输出的,因此没有问题。 The problem is that we want to automate the deletion of old builds, and we need to also delete the .PDB files at the same time. 问题在于,我们要自动删除旧版本,并且还需要同时删除.PDB文件。 Currently this can only be manually, and before deleting the build by hand as well, otherwise we lose the transaction ID. 目前,这只能是手动的,并且在手动删除构建之前,否则,我们将丢失交易ID。 Is there a way of hooking into the automated delete process in MSBuild and putting some custom targets in? 有没有办法挂入MSBuild中的自动删除过程并放入一些自定义目标?

I'm working on ironing out some problems with MSBuild on a large project. 我正在努力解决大型项目上的MSBuild问题。 As part of a custom build target in our MSBuild setup we insert the .PDB files into Symbol Storeafter the build is successful. 作为我们的MSBuild设置中自定义生成目标的一部分,我们在生成成功后将.PDB文件插入Symbol Store。

Kudos for using a Symbol Server. 使用符号服务器的荣誉。 I will never regret for using it. 我永远不会后悔使用它。

For your special case I would consider writing a custom MSBuild task and hooking that task into the MSBuild script. 对于您的特殊情况,我会考虑编写一个自定义MSBuild任务并将该任务挂接到MSBuild脚本中。

Writing a task is very simple and you can just call it from the project file very easily: 编写任务非常简单,您可以非常容易地从项目文件中调用它:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <UsingTask TaskName="SimpleTask3.SimpleTask3" 
        AssemblyFile="SimpleTask3\bin\debug\simpletask3.dll"/>

    <Target Name="MyTarget">
        <SimpleTask3 MyProperty="Hello!"/>
    </Target>
</Project>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM