Search code examples
c#visual-studio

Why should I NOT use the /optimize switch to compile my C# code?


In Visual Studio 2008 there is an option "Optimize Code" that probably corresponds to the /optimize option. It is never enabled, not even when in "Release" mode.

Why should I not want this option to be enabled at all times?


Solution

  • It is on per default for release builds (perhaps you changed the settings for Release builds?). Turn it off to make debugging easier. For release code, turn it on.