NovaDev
NovaDev

Reputation: 2961

Azure Devops not building in Release configuration

I'm using #if DEBUG, and when I use Azure Devops to build and deploy, it's still deploying in debug mode, and not release mode, even though it says the build configuration is release. What am I doing wrong? I'm not as experienced in this realm, so I will happily edit/update this question to be more clear, since I'm pretty sure I need to add more detail, but not sure what I would need to add.

ETA: task variables per request

Task Variables Here's my variables Set at release variable

Upvotes: 2

Views: 2134

Answers (1)

gunr2171
gunr2171

Reputation: 17579

Setting build-time variables alone is not enough to get a pipeline task to perform as you want. Unless the task has some hidden functionality (which usually they don't), you need to explicitly use the variable in your task.

Variables, like your BuildConfiguration variable, are arbitrarily named. That means you need to be explicit in your use of the variable.

In the circled region here:

enter image description here

Either hard-code the configuration you want to use (Release or Debug), or use the variable syntax to use the variable value.

$(BuildConfiguration)

Note: you're going to want to make sure you use "Release" or "Debug", WITH the capital starting letter. If you ever make the move to Linux, compiling with "release" rather than "Release" will cause you to have different folder names than you expect, and because Linux's file system is case sensitive, it might introduce bugs in your pipeline.

Upvotes: 3

Related Questions