I have a c# .net core project that is using preprocessor directives ( #if DEBUG) to enable unsafe SSL Connections during debugging. Now when I release-build the whole project and open the generated dll with dotPeek I still find the code surrounded by the '#if DEBUG' in there. I would have thought that this code is removed during the build. I also checked that in the BuildSettings from VS the "define DEBUG" is unchecked for the Release-Build-Configuration. Is my idea of how this works incorrect ? Where in the .dll would I find the definition of 'DEBUG' at all - at the top of the file or somewhere else ?
#if DEBUG
DisableSecureSSLConnections();
#endif
As @canton7 mentioned in the comment section. The actual problem was the .pdb file was available for the disassembler. This caused dotPeek to show the actual source