Force function to return value and make compile error C#

后端 未结 4 1075
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 06:23

I have a class and a method within that class. However this class method returns a string. When I call the class method I don\'t get an error even though I\'m not catching

4条回答
  •  别那么骄傲
    2021-01-18 06:39

    If your function has side effects then your should create unused variable and catch value. Compiler on release options delete this variable.

    But if you don't have side effects in function: you may use visual studio tools such as "Watch window" and "Immediate window"

提交回复
热议问题