The project has app.config . When build on app.config necessary that the transformation file be rolled. But with the condition that the file for transformation exists. I understand that this is done in the csproj project in Target . But I do not understand how to set the condition and use the transformation. Will you help?

  • one
    There are ready-made mechanisms (SlowCheetah), do not want to use in your project? Well, or to you, you can unzip the mechanisms of this extension and see how it works. With SlowCheetah, everything is in the box — you just need to click rightclick on app.config and select the add transform option. - AK
  • And in it you can put a condition? What to use transformation, only in case this file is? - alexander
  • The transformations in this extension are unconditional: there are two ready-made transforms (app.Debug.config and app.Release.config), each connecting to its own Target. You did not say the script, so I will not write as an answer - it is not clear, you generally need something or something else. - AK
  • I made using SlowCheetah. I set the condition <Target Name="UseAppDebugConfig" Condition="Exists('\app.Debug.config')"> and it was enough for me - alexander
  • Then write the answer and check. - AK

1 answer 1

made using SlowCheetah. Set the condition <Target Name="UseAppDebugConfig" Condition="Exists('\app.Debug.config')">