C# error “Not all code paths return a value”

后端 未结 8 1863
长发绾君心
长发绾君心 2020-12-12 06:05

I translated this part of the code from vb to c# and giving me this error message. \"Not all code paths return a value\". What is the problem? Thanks in advance.

<         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 06:12

    It is must to return proper value in any case. so try to maintain try catch block with return value or outside of try/catch block if nothing to return in try / catch block.

提交回复
热议问题