Knowledge.ToString()

Weird errors for VB .Net classes defined in App_Code folder

Recently I was making a .Net 3.5 webforms application compile on my computer. The application was written in VB .Net. There were couple of classes which were causing weird issues.

Visual Studio compiler generated “variable not declared”, “Exception not declared”, “End Sub does not have matching sub”, “line continuation character does not work in VB 9” etc.

I tried to remove all the functions and kept only the bare minimum code with single “return” statement but compiler did not like it and still screamed.

Finally on internet, there were some suggestions to move the code out of App_Code folder and put it anywhere within a sub-folder. As soon as I moved code and compiled, it worked.

Share

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *