我使用SlowCheetah来转换我的app.configs.我有一个多项目解决方案,其中一个项目执行构建后事件,其中bin的输出复制到其他位置.我发现SlowCheetah会在构建后事件之后进行转换,因此我要复制的app.config是预先转换的版本.
I use SlowCheetah to transform my app.configs. I have a multi-project solution where one of the projects executes a post-build event where the output of the bin is copied elsewhere. I've found that SlowCheetah does it's transforms after the post-build event, so the app.config I'm copying is the pre-transformed version.
有人对SlowCheetah转换后如何执行我的副本提出建议吗?这是否需要我编写自定义构建任务?
Does anyone have a suggestion of how I can execute my copy after the SlowCheetah transforms? Is this going to require that I write a custom build task?
推荐答案如果您使用msbuild 4.0来构建项目,则可以使用新的AfterTargets BeforeTargets属性连接到慢猎豹目标.
If you are using msbuild 4.0 for building your projects - you can hook to slowcheetah targets with new AfterTargets BeforeTargets attributes.
我不知道您想使用的目标名称到底是什么,但是这段代码可以为您提供基本的概念
I dont know what exactly target name you want to hook after but this code could gave you base concept how to do this
<Project ToolsVersion="4.0" xmlns="schemas.microsoft/developer/msbuild/2003"> <Target Name="Some_Target_Name" AfterTargets="TransformAllFiles" > <Message Text="= Script here will run after SlowCheetah TransformAllFiles ="/> </Target> <Project>我安装了SlowCheetah,发现AfterTargets属性应该是"TransformAllFiles". 只需设置您的目标依赖项AfterTargets="TransformAllFiles"
Edited: I installed SlowCheetah and found that AfterTargets attribute should be "TransformAllFiles". Just set up your target dependency AfterTargets="TransformAllFiles"
更多推荐
SlowCheetah在构建后事件后执行
发布评论