0
votes

I'm trying to set a release on Azure Pipelines, but I need to release in debug mode (or in some way that doesn't transform web.config file, keeping with settings in debug mode).

I already set the build pipeline to build in Debug mode (setting System.Debug variable to true), in Releases I set it with the same variable (System.Debug = true), unchecked the boxes "XML transformation" and "XML variable substitution", but unsuccessful. The build is always transforming the web.config file to Release mode.

Sets of XML transform during release set

Is there something I'm missing?

2
Glad to hear that your issue has been fixed, you could mark your answer as accepted, it will pin the answer to the top so others reading your question read that answer first. About how to accept an answer, you can refer to meta.stackexchange.com/questions/5234/…Frank Wang-MSFT

2 Answers

0
votes

You can check your build artifact and confirm if the web.config has been transformed in build pipeline.

If the web.config has been transformed in build pipleine, you can try to use the MSBuild argument to prevent transforming web.config.

/p:IsTransformWebConfigDisabled=true

Or you can add the below xml in your .csproj file.

  <PropertyGroup>

    <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>

  </PropertyGroup>
0
votes

I figured out the problem. Although I set the related variables System.Debug in build release and Deploy, I forgot to change the variable BuildConfiguration to "debug" on build pipeline.

To be more clarify:

  • In Azure DevOps, Pipelines > Builds (or Pipelines, on new UX in portal), open your build pipeline.
  • Click in Edit, Variables tab, change the value from variable BuildConfiguration from "release" to "debug"