문제

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

도움이 되었습니까?

해결책 2

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.

다른 팁

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"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top