Beware, while it is generally true that most calls to System.Diagnostics.Debug are not present in the Release builds, there is one exception. When using C++/CLI there is no difference in Debug and Release builds. As is documented here: https://learn.microsoft.com/en-us/cpp/dotnet/debug-class-cpp-cli?view=msvc-170