0

Referenced this SO question first, to no avail - Use Cake to build .Net Core project using Debug configuration

Also checked out the Cake docs, as well as their github, these two pages looking promising but not useful: https://cakebuild.net/docs/running-builds/configuration/set-configuration-values

https://cakebuild.net/docs/running-builds/configuration/default-configuration-values

I have a cake script that we run, and I can attempt to manually run the script such that it would produce a Debug configuration of my project...

dotnet cake "working\build.cake" --target="myProject" --verbosity=normal --configuration "Debug"

The output from running this command:

----------------------------------------  
Setup
----------------------------------------  
Error: One or more errors occurred. (Only release mode is supported)
        Only release mode is supported

So...does anyone know if its true? Is it true that cake only supports release mode?

NOTE: Added the tag for .NET-5 since our codebase is using it. Unsure if this could be significant.

Max
  • 808
  • 11
  • 25
  • You absolutely _can_ set the configuration to be whatever you want. I think it would be helpful if you update your question to show the Cake script that you are currently using, and we can go from there. – Gary Ewan Park Mar 14 '22 at 22:14
  • @GaryEwanPark - I will look at adding the cake script shortly here...my question for you however, does "configuration" not directly refer to Visual Studio's solution configurations? i.e. Debug, Release? Assuming it does directly refer to those configurations, I would have thought being able to pass in a configuration of "Debug" would "just work"... – Max Mar 15 '22 at 15:35
  • Cake is a build orchestration tool. It can orchestrate lots of tools, including MSBuild and dotnet CLI. While these two tools have the concept of a build configuration parameter, not all tools have this. As such, there is nothing that happens automatically in this area, no. You would need to use the Argument alias to accept the Configuration value and then pass this to the tools where necessary: https://cakebuild.net/api/Cake.Common/ArgumentAliases/ Having an example of what you are trying to do will help to provide a better answer. – Gary Ewan Park Mar 15 '22 at 18:00

0 Answers0