How do I check the active solution configuration Visual Studio built with at runtime?

前端 未结 4 1590
梦谈多话
梦谈多话 2020-12-20 14:11

I would like to enable/disable some code based on a custom solution configuration I added in Visual Studio. How do I check this value at runtime?

4条回答
  •  遥遥无期
    2020-12-20 14:22

    I'm not sure if you can figure out the exact name of the build configuration. Howerver, if you use Debug.Assert(...), that code will only be run when you compile in debug mode. Not sure it that helps you at all.

提交回复
热议问题