Can you call Slow Cheetah from the command line?

亡梦爱人 提交于 2019-12-07 18:00:27

问题


Can you call Slow Cheetah from the command line? I am looking to add a post build event to transform my config file for a variety of different environments.

Cheers Dee


回答1:


I had an issue with

    AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll"

Changing that to

    AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.targets"

Allows it to run more dynamically without having to ever change the version.




回答2:


Step 1) Create a build file Transform.msbuild

<Project ToolsVersion="4.0" DefaultTargets="TransformConfiguration" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <UsingTask TaskName="TransformXml"
             AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>

    <Target Name="TransformConfiguration">
    <TransformXml Source="$(sourceConfig)"
                  Transform="$(valuesConfig)"
                  Destination="$(outputConfig)"/>
    </Target>
</Project>

Step 2) Call MsBuild

msbuild Transform.msbuild /p:sourceConfig="app.config" /p:valuesConfig="App.Production.config" /p:outputConfig="AppName.config"


来源:https://stackoverflow.com/questions/19404266/can-you-call-slow-cheetah-from-the-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!