Thursday, May 15, 2008

Project does not have a valid Sub Main

I encountered this error and it didn't make sense to me because I didn't have a Sub Main. Why vb.net gave that message is still a riddle to me. How did I resolve this? First you need to find out to what project the error pertains. Unfortunately double clicking the error does not tell you where the error resides. So select the messages tab and you will find in what project this error occurs.


Once you know what project this occurs, copy the code and paste it temporarily in a text document. Then remove that particular project. Then save all and close the solution. Then look up the physical location of the project that you just deleted and make sure that the directory of the deleted directory does not exist. Now restart your solution and add back your project again. And voila, no more errors.

No comments: