Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where are the settings for the Release and Debug Build Configurations in .net core

Tags:

.net-core

right now I have 3 build configurations: Debug, Release and Cfg1

I noticed that Cfg1 would produce dll of the same size as Debug (larger than Release), so using trial and error I've found that adding this code in project.json:

  "configurations": {
    "Cfg1": { "buildOptions": { "optimize": true } }
  }

would make the dll the same size as Release

however , for both Release or Debug I couldn't find any configuration in project.json or in the solution file that would set optimize: true, so where is the configuration for Debug and Release is it embedded somewhere ?

like image 210
Omu Avatar asked Oct 31 '25 17:10

Omu


1 Answers

Yes, the configurations of Debug and Release are hardcoded in .Net Core CLI code.

In effect, the default configurations are:

"configurations": {
  "Debug": {
    "buildOptions": {
      "define": [ "DEBUG", "TRACE"],
      "optimize": false
    }
  },
  "Release": {
    "buildOptions": {
      "define": [ "RELEASE", "TRACE"],
      "optimize": true
    }
  }
}
like image 87
svick Avatar answered Nov 04 '25 03:11

svick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!