Simple C# Noop Statement

后端 未结 15 761
面向向阳花
面向向阳花 2021-02-01 01:14

What is a simple Noop statement in C#, that doesn\'t require implementing a method? (Inline/Lambda methods are OK, though.)

My current use case: I want to occupy the c

15条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 01:47

    Are you trying to debug a release (optimised) build? It is normally the optimiser that removes unreferenced variables and empty blocks.

    Two solutions:

    • Debug in a debug build.
    • Put a break point on the catch itself and use $exception – created by the debugger to reference the exception in flight – in the Locals tool window.

提交回复
热议问题