How does .NET handle variables inside scope
I'm just couris about whats happning behind the scenes. I have this code and of course it will not compile cause I create the hello variable inside a if statement and later try to declare it agian. Why dosen't .NET allow me to do so? Whats happning behind the scences that could make the hello variable interfeer with the one inside the statement. 

It's very stright forward why this could interfeer if the variable was declared before the if statement.

        public void Test() {
            if (true)
            {
                var hello = "";
            }
            var hello = "";

            Console.Write(hello);
        }
How does .NET handle variables inside scope
===

I'm just couris about whats happning behind the scenes. I have this code and of course it will not compile cause I create the hello variable inside a if statement and later try to declare it agian. Why dosen't .NET allow me to do so? Whats happning behind the scences that could make the hello variable interfeer with the one inside the statement. 

It's very stright forward why this could interfeer if the variable was declared before the if statement.

        public void Test() {
            if (true)
            {
                var hello = "";
            }
            var hello = "";

            Console.Write(hello);
        }