If I have a code like this:
public class Program
{
public static void Main()
{
string bar = \"\";
int foo = 24;
}
}
You have to differentiate between the human-readable text-based form of CLI and the machine-readable compiled form of CLI.
In text CLI, local variables indeed can have names (see §II.15.4.1.3 of ECMA-335, as explained in Damien's answer).
But in the binary form, local variables don't have names. For that, look at §II.23.2.6, where the binary format for a method's local variable signature (list of all its local variables) is specified. And it doesn't contain any mention of variable names:
So, if some tool wants to know the original name of a local variable, it has to look into the debugging information contained in the PDB file. If that's not present, there is no way to find out the name.