How can I disable compiler optimization in C#?

At the command line (csc), /optimize-

In the IDE, project properties → build → “optimize code”

For some JIT optimizations, you can use [MethodImpl(...)]

Leave a Comment