Compilation error with a project which is converted from Windows legacy to Windows and has Flow Switch Activities.
Issue: Project converted from Windows Legacy to Windows and having flow switch activities gives compilation error in Studio.
Error Message:
* (1,202400): error CS0841: Cannot use local variable XXX' before it is declared
* (1,230408): error CS0841: Cannot use local variable 'XXX' before it is declared
* (1,268915): error CS0841: Cannot use local variable 'XXX' before it is declared
Root Cause: This issue happens, if there is a self loop that gets created in flow switch activities during Windows Legacy to Windows conversion process.
Resolution:
The self loops (direct loops) that gets created in flow switch activities during Windows Legacy to Windows conversion process, needs to be identified and deleted.
Refer screenshot below.