Linker error LNK2038: mismatch detected in Release mode

Your app is being compiled in release mode, but you’re linking against the debug version of PCRE, which had /MTd (or similar) set, thus causing the mismatch in iterator debugging level in the CRT. Recompile PCRE in release mode to match your own application. The detect_mismatch pragma in VS 2010 is what causes this error … Read more

How to debug in release mode?

In VS, right click your project, chose “Properties”. Click the C/C++ node. Set Debug Information Format to C7 compatible (/Z7) or Program Database (/Zi). Expand Linker and click the General node. Set Enable Incremental Linking to No (/INCREMENTAL:NO). Select the Debugging node. Set Generate Debug Info to Yes (/DEBUG). Select the Optimization node. Set References … Read more

How to check if an assembly was built using Debug or Release configuration?

Check this. The idea is that you get the list of assembly attributes using Assembly.GetCustomAttributes() and search for DebuggableAttribute and then find if such attribute has IsJITTrackingEnabled property set. public bool IsAssemblyDebugBuild(Assembly assembly) { return assembly.GetCustomAttributes(false).OfType<DebuggableAttribute>().Any(da => da.IsJITTrackingEnabled); }

C# release version has still .pdb file

If you want to disable pdb file generation, you need to use the “Advanced build settings” dialog available in project properties after clicking the “Advanced…” button” located in the lower part of the Build tab. Set Output – Debug info: to None for release build configuration and no pdb files will be generated.

Common reasons for bugs in release version not present in debug mode

Many times, in debug mode in C++ all variables are null initialized, whereas the same does not happen in release mode unless explicitly stated. Check for any debug macros and uninitialized variables Does your program uses threading, then optimization can also cause some issues in release mode. Also check for all exceptions, for example not … Read more