user6058220 user6058220 - 3 months ago 9
C# Question

How do I perform debug and release configuration builds

In previous .NET Core I could do the following:-

{
"configurations": {
"Debug": {
"compilationOptions": {
"define": ["DEBUG", "TRACE"]
}
},
"Release": {
"compilationOptions": {
"define": ["RELEASE", "TRACE"],
"optimize": true
}
}
}
}


but it seems to be replaced by buildOptions but is a single configuration. What is the intended method now and how do I create this in the latest .NET Core?

Answer

Simply replace compilationOptions with buildOptions

"configurations": {
  "Debug": {
    "buildOptions": {
      "define": [ "DEBUG", "TRACE" ]
    }
  },
  "Release": {
    "buildOptions": {
      "define": [ "RELEASE", "TRACE" ],
      "optimize": true
    }
}}