Home > Software engineering >  If (1 = 1) Then is throwing invalid cast error
If (1 = 1) Then is throwing invalid cast error

Time:03-15

I'm using Visual Studio 2019, and tried this in two different computers.

Can someone explain what is going on?

CodePudding user response:

I have tried it quickly in vs2020 and it works for me...

enter image description here

CodePudding user response:

Oh, actually it was an error in the next line, which is weird because it showed the error on the previous line. Like:

If 1=1 Then
    If enumVariable = stringVariable

But it broke on the first line

  • Related